From e7b3093986df5e319672f0e69a55a2c8a0343610 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Mon, 21 Dec 2020 11:01:29 +0000 Subject: [PATCH] composer update --- composer.lock | 212 +- vendor/composer/autoload_files.php | 2 +- vendor/composer/autoload_static.php | 2 +- vendor/composer/installed.json | 249 ++- .../fzaninotto/faker/src/Faker/Generator.php | 5 + vendor/monolog/monolog/CHANGELOG.md | 4 + vendor/monolog/monolog/composer.json | 13 +- vendor/monolog/monolog/phpstan.neon.dist | 16 + .../monolog/src/Monolog/ErrorHandler.php | 1 + .../src/Monolog/Handler/DynamoDbHandler.php | 1 + .../src/Monolog/Handler/FirePHPHandler.php | 2 +- .../src/Monolog/Handler/GelfHandler.php | 2 +- .../src/Monolog/Handler/HipChatHandler.php | 4 +- .../src/Monolog/Handler/RavenHandler.php | 2 +- .../src/Monolog/Handler/RedisHandler.php | 2 +- .../src/Monolog/Handler/StreamHandler.php | 2 +- vendor/monolog/monolog/src/Monolog/Logger.php | 2 +- .../Processor/PsrLogMessageProcessor.php | 37 +- vendor/monolog/monolog/src/Monolog/Utils.php | 2 +- vendor/nesbot/carbon/composer.json | 3 + vendor/nesbot/carbon/readme.md | 2 +- .../carbon/src/Carbon/CarbonInterval.php | 31 +- .../nesbot/carbon/src/Carbon/CarbonPeriod.php | 54 +- .../nesbot/carbon/src/Carbon/Cli/Invoker.php | 2 +- .../Carbon/Doctrine/CarbonTypeConverter.php | 2 +- .../nesbot/carbon/src/Carbon/Traits/Date.php | 8 +- .../carbon/src/Carbon/Traits/Difference.php | 9 +- .../carbon/src/Carbon/Traits/Localization.php | 2 +- .../nesbot/carbon/src/Carbon/Traits/Mixin.php | 10 + .../carbon/src/Carbon/Traits/Rounding.php | 8 +- .../src/Carbon/Traits/Serialization.php | 3 +- .../php-parser/.github/workflows/main.yml | 86 + vendor/nikic/php-parser/README.md | 2 +- vendor/nikic/php-parser/grammar/php7.y | 23 +- .../php-parser/lib/PhpParser/Parser/Php7.php | 1796 ++++++++--------- .../lib/PhpParser/ParserAbstract.php | 13 +- .../prophecy/.github/workflows/build.yml | 42 + vendor/phpspec/prophecy/CHANGES.md | 5 + vendor/phpspec/prophecy/README.md | 2 +- vendor/phpspec/prophecy/composer.json | 2 +- .../ClassPatch/ProphecySubjectPatch.php | 2 +- vendor/swiftmailer/swiftmailer/.gitattributes | 4 +- vendor/swiftmailer/swiftmailer/.gitignore | 1 + vendor/swiftmailer/swiftmailer/.php_cs.dist | 9 +- vendor/swiftmailer/swiftmailer/.travis.yml | 10 +- vendor/swiftmailer/swiftmailer/CHANGES | 11 +- vendor/swiftmailer/swiftmailer/LICENSE | 2 +- vendor/swiftmailer/swiftmailer/composer.json | 9 +- .../swiftmailer/doc/introduction.rst | 2 +- .../swiftmailer/swiftmailer/doc/messages.rst | 4 +- .../swiftmailer/lib/classes/Swift.php | 4 +- .../lib/classes/Swift/AddressEncoder.php | 4 +- .../lib/classes/Swift/Attachment.php | 2 +- .../Swift/ByteStream/ArrayByteStream.php | 8 +- .../Swift/ByteStream/FileByteStream.php | 8 +- .../GenericFixedWidthReader.php | 2 +- .../Swift/CharacterReader/UsAsciiReader.php | 4 +- .../Swift/CharacterReader/Utf8Reader.php | 8 +- .../SimpleCharacterReaderFactory.php | 4 +- .../lib/classes/Swift/CharacterStream.php | 2 - .../CharacterStream/ArrayCharacterStream.php | 14 +- .../CharacterStream/NgCharacterStream.php | 4 +- .../lib/classes/Swift/DependencyContainer.php | 12 +- .../lib/classes/Swift/EmbeddedFile.php | 2 +- .../lib/classes/Swift/Encoder/QpEncoder.php | 6 +- .../classes/Swift/Encoder/Rfc2231Encoder.php | 4 +- .../classes/Swift/Events/CommandListener.php | 2 - .../classes/Swift/Events/EventDispatcher.php | 21 +- .../classes/Swift/Events/ResponseListener.php | 2 - .../lib/classes/Swift/Events/SendListener.php | 4 - .../Swift/Events/SimpleEventDispatcher.php | 23 +- .../Swift/Events/TransportChangeListener.php | 8 - .../Events/TransportExceptionListener.php | 2 - .../lib/classes/Swift/FailoverTransport.php | 2 +- .../lib/classes/Swift/FileSpool.php | 2 +- .../lib/classes/Swift/Filterable.php | 3 +- .../lib/classes/Swift/KeyCache.php | 7 +- .../classes/Swift/KeyCache/ArrayKeyCache.php | 14 +- .../classes/Swift/KeyCache/DiskKeyCache.php | 12 +- .../Swift/KeyCache/KeyCacheInputStream.php | 4 - .../classes/Swift/LoadBalancedTransport.php | 2 +- .../swiftmailer/lib/classes/Swift/Message.php | 4 +- .../lib/classes/Swift/Mime/Attachment.php | 2 +- .../ContentEncoder/Base64ContentEncoder.php | 6 +- .../ContentEncoder/NativeQpContentEncoder.php | 14 +- .../ContentEncoder/PlainContentEncoder.php | 8 +- .../Mime/ContentEncoder/QpContentEncoder.php | 4 +- .../ContentEncoder/QpContentEncoderProxy.php | 2 +- .../classes/Swift/Mime/EncodingObserver.php | 2 - .../Mime/HeaderEncoder/QpHeaderEncoder.php | 2 +- .../Swift/Mime/Headers/AbstractHeader.php | 14 +- .../Mime/Headers/IdentificationHeader.php | 4 +- .../Swift/Mime/Headers/MailboxHeader.php | 8 +- .../Mime/Headers/ParameterizedHeader.php | 12 +- .../classes/Swift/Mime/Headers/PathHeader.php | 4 +- .../lib/classes/Swift/Mime/MimePart.php | 4 +- .../Swift/Mime/SimpleHeaderFactory.php | 3 +- .../classes/Swift/Mime/SimpleHeaderSet.php | 20 +- .../lib/classes/Swift/Mime/SimpleMessage.php | 16 +- .../classes/Swift/Mime/SimpleMimeEntity.php | 4 +- .../lib/classes/Swift/MimePart.php | 2 +- .../lib/classes/Swift/NullTransport.php | 2 +- .../Swift/Plugins/BandwidthMonitorPlugin.php | 6 +- .../classes/Swift/Plugins/DecoratorPlugin.php | 12 +- .../classes/Swift/Plugins/LoggerPlugin.php | 8 +- .../Swift/Plugins/Loggers/ArrayLogger.php | 2 +- .../classes/Swift/Plugins/MessageLogger.php | 2 +- .../Swift/Plugins/PopBeforeSmtpPlugin.php | 24 +- .../Swift/Plugins/RedirectingPlugin.php | 4 +- .../lib/classes/Swift/Plugins/Reporter.php | 5 +- .../classes/Swift/Plugins/ReporterPlugin.php | 6 +- .../lib/classes/Swift/SendmailTransport.php | 2 +- .../lib/classes/Swift/Signers/BodySigner.php | 2 - .../lib/classes/Swift/Signers/DKIMSigner.php | 8 +- .../classes/Swift/Signers/DomainKeySigner.php | 4 +- .../classes/Swift/Signers/HeaderSigner.php | 4 - .../classes/Swift/Signers/OpenDKIMSigner.php | 6 +- .../lib/classes/Swift/Signers/SMimeSigner.php | 6 +- .../lib/classes/Swift/SmtpTransport.php | 2 +- .../lib/classes/Swift/SpoolTransport.php | 2 +- .../ByteArrayReplacementFilter.php | 14 +- .../lib/classes/Swift/Transport.php | 5 +- .../Swift/Transport/AbstractSmtpTransport.php | 39 +- .../Esmtp/Auth/CramMd5Authenticator.php | 10 +- .../Esmtp/Auth/NTLMAuthenticator.php | 36 +- .../Esmtp/Auth/PlainAuthenticator.php | 2 +- .../Swift/Transport/Esmtp/AuthHandler.php | 2 +- .../Swift/Transport/Esmtp/Authenticator.php | 5 +- .../Swift/Transport/EsmtpTransport.php | 12 +- .../Swift/Transport/FailoverTransport.php | 12 +- .../lib/classes/Swift/Transport/IoBuffer.php | 2 - .../Swift/Transport/LoadBalancedTransport.php | 12 +- .../classes/Swift/Transport/NullTransport.php | 6 +- .../Swift/Transport/SendmailTransport.php | 6 +- .../classes/Swift/Transport/StreamBuffer.php | 22 +- .../lib/swiftmailer_generate_mimes_config.php | 10 +- .../swiftmailer/swiftmailer/phpunit.xml.dist | 38 - .../tests/IdenticalBinaryConstraint.php | 62 - .../swiftmailer/tests/StreamCollector.php | 11 - .../tests/SwiftMailerSmokeTestCase.php | 46 - .../swiftmailer/tests/SwiftMailerTestCase.php | 38 - .../_samples/charsets/iso-2022-jp/one.txt | 11 - .../_samples/charsets/iso-8859-1/one.txt | 19 - .../tests/_samples/charsets/utf-8/one.txt | 22 - .../tests/_samples/charsets/utf-8/three.txt | 45 - .../tests/_samples/charsets/utf-8/two.txt | 3 - .../tests/_samples/dkim/dkim.test.priv | 15 - .../tests/_samples/dkim/dkim.test.pub | 6 - .../swiftmailer/tests/_samples/files/data.txt | 1 - .../tests/_samples/files/swiftmailer.png | Bin 3194 -> 0 bytes .../tests/_samples/files/textfile.zip | Bin 202 -> 0 bytes .../swiftmailer/tests/_samples/smime/CA.srl | 1 - .../swiftmailer/tests/_samples/smime/ca.crt | 21 - .../swiftmailer/tests/_samples/smime/ca.key | 27 - .../tests/_samples/smime/create-cert.sh | 40 - .../tests/_samples/smime/encrypt.crt | 19 - .../tests/_samples/smime/encrypt.key | 27 - .../tests/_samples/smime/encrypt2.crt | 19 - .../tests/_samples/smime/encrypt2.key | 27 - .../tests/_samples/smime/intermediate.crt | 19 - .../tests/_samples/smime/intermediate.key | 27 - .../swiftmailer/tests/_samples/smime/sign.crt | 19 - .../swiftmailer/tests/_samples/smime/sign.key | 27 - .../tests/_samples/smime/sign2.crt | 19 - .../tests/_samples/smime/sign2.key | 27 - .../tests/acceptance.conf.php.default | 37 - .../Swift/AttachmentAcceptanceTest.php | 12 - .../FileByteStreamAcceptanceTest.php | 162 -- ...leCharacterReaderFactoryAcceptanceTest.php | 179 -- .../DependencyContainerAcceptanceTest.php | 22 - .../Swift/EmbeddedFileAcceptanceTest.php | 12 - .../Encoder/Base64EncoderAcceptanceTest.php | 45 - .../Swift/Encoder/QpEncoderAcceptanceTest.php | 54 - .../Encoder/Rfc2231EncoderAcceptanceTest.php | 50 - .../KeyCache/ArrayKeyCacheAcceptanceTest.php | 173 -- .../KeyCache/DiskKeyCacheAcceptanceTest.php | 173 -- .../Swift/MessageAcceptanceTest.php | 55 - .../Swift/Mime/AttachmentAcceptanceTest.php | 126 -- .../Base64ContentEncoderAcceptanceTest.php | 56 - .../NativeQpContentEncoderAcceptanceTest.php | 88 - .../PlainContentEncoderAcceptanceTest.php | 88 - .../QpContentEncoderAcceptanceTest.php | 160 -- .../Swift/Mime/EmbeddedFileAcceptanceTest.php | 139 -- .../Base64HeaderEncoderAcceptanceTest.php | 32 - .../Swift/Mime/MimePartAcceptanceTest.php | 130 -- .../Mime/SimpleMessageAcceptanceTest.php | 1250 ------------ .../Swift/MimePartAcceptanceTest.php | 15 - .../AbstractStreamBufferAcceptanceTest.php | 131 -- .../BasicSocketAcceptanceTest.php | 33 - .../StreamBuffer/ProcessAcceptanceTest.php | 26 - .../StreamBuffer/SocketTimeoutTest.php | 65 - .../StreamBuffer/SslSocketAcceptanceTest.php | 40 - .../StreamBuffer/TlsSocketAcceptanceTest.php | 39 - .../swiftmailer/tests/bootstrap.php | 21 - .../tests/bug/Swift/Bug111Test.php | 42 - .../tests/bug/Swift/Bug118Test.php | 20 - .../tests/bug/Swift/Bug206Test.php | 40 - .../tests/bug/Swift/Bug274Test.php | 25 - .../swiftmailer/tests/bug/Swift/Bug34Test.php | 75 - .../swiftmailer/tests/bug/Swift/Bug35Test.php | 73 - .../swiftmailer/tests/bug/Swift/Bug38Test.php | 192 -- .../tests/bug/Swift/Bug518Test.php | 38 - .../swiftmailer/tests/bug/Swift/Bug51Test.php | 110 - .../tests/bug/Swift/Bug534Test.php | 38 - .../tests/bug/Swift/Bug650Test.php | 38 - .../swiftmailer/tests/bug/Swift/Bug71Test.php | 20 - .../swiftmailer/tests/bug/Swift/Bug76Test.php | 71 - ...FileByteStreamConsecutiveReadCallsTest.php | 18 - .../tests/fixtures/MimeEntityFixture.php | 67 - .../swiftmailer/tests/smoke.conf.php.default | 63 - .../smoke/Swift/Smoke/AttachmentSmokeTest.php | 33 - .../smoke/Swift/Smoke/BasicSmokeTest.php | 23 - .../Smoke/HtmlWithAttachmentSmokeTest.php | 33 - .../Swift/Smoke/InternationalSmokeTest.php | 40 - .../Swift/ByteStream/ArrayByteStreamTest.php | 202 -- .../GenericFixedWidthReaderTest.php | 43 - .../CharacterReader/UsAsciiReaderTest.php | 52 - .../Swift/CharacterReader/Utf8ReaderTest.php | 65 - .../ArrayCharacterStreamTest.php | 358 ---- .../unit/Swift/DependencyContainerTest.php | 191 -- .../unit/Swift/Encoder/Base64EncoderTest.php | 173 -- .../unit/Swift/Encoder/QpEncoderTest.php | 400 ---- .../unit/Swift/Encoder/Rfc2231EncoderTest.php | 141 -- .../unit/Swift/Events/CommandEventTest.php | 34 - .../unit/Swift/Events/EventObjectTest.php | 32 - .../unit/Swift/Events/ResponseEventTest.php | 38 - .../tests/unit/Swift/Events/SendEventTest.php | 96 - .../Events/SimpleEventDispatcherTest.php | 142 -- .../Swift/Events/TransportChangeEventTest.php | 30 - .../Events/TransportExceptionEventTest.php | 41 - .../unit/Swift/KeyCache/ArrayKeyCacheTest.php | 240 --- .../SimpleKeyCacheInputStreamTest.php | 73 - .../Mailer/ArrayRecipientIteratorTest.php | 42 - .../tests/unit/Swift/MailerTest.php | 145 -- .../tests/unit/Swift/MessageTest.php | 133 -- .../Swift/Mime/AbstractMimeEntityTest.php | 1092 ---------- .../tests/unit/Swift/Mime/AttachmentTest.php | 321 --- .../Base64ContentEncoderTest.php | 323 --- .../PlainContentEncoderTest.php | 171 -- .../ContentEncoder/QpContentEncoderTest.php | 516 ----- .../unit/Swift/Mime/EmbeddedFileTest.php | 59 - .../HeaderEncoder/Base64HeaderEncoderTest.php | 13 - .../HeaderEncoder/QpHeaderEncoderTest.php | 221 -- .../Swift/Mime/Headers/DateHeaderTest.php | 90 - .../Mime/Headers/IdentificationHeaderTest.php | 192 -- .../Swift/Mime/Headers/MailboxHeaderTest.php | 367 ---- .../Mime/Headers/ParameterizedHeaderTest.php | 396 ---- .../Swift/Mime/Headers/PathHeaderTest.php | 95 - .../Mime/Headers/UnstructuredHeaderTest.php | 353 ---- .../tests/unit/Swift/Mime/IdGeneratorTest.php | 32 - .../tests/unit/Swift/Mime/MimePartTest.php | 234 --- .../Swift/Mime/SimpleHeaderFactoryTest.php | 169 -- .../unit/Swift/Mime/SimpleHeaderSetTest.php | 734 ------- .../unit/Swift/Mime/SimpleMessageTest.php | 837 -------- .../unit/Swift/Mime/SimpleMimeEntityTest.php | 12 - .../Swift/Plugins/AntiFloodPluginTest.php | 93 - .../Plugins/BandwidthMonitorPluginTest.php | 128 -- .../Swift/Plugins/DecoratorPluginTest.php | 284 --- .../unit/Swift/Plugins/LoggerPluginTest.php | 188 -- .../Swift/Plugins/Loggers/ArrayLoggerTest.php | 65 - .../Swift/Plugins/Loggers/EchoLoggerTest.php | 24 - .../Swift/Plugins/PopBeforeSmtpPluginTest.php | 101 - .../Swift/Plugins/RedirectingPluginTest.php | 183 -- .../unit/Swift/Plugins/ReporterPluginTest.php | 86 - .../Plugins/Reporters/HitReporterTest.php | 64 - .../Plugins/Reporters/HtmlReporterTest.php | 54 - .../Swift/Plugins/ThrottlerPluginTest.php | 102 - .../unit/Swift/Signers/DKIMSignerTest.php | 220 -- .../unit/Swift/Signers/OpenDKIMSignerTest.php | 45 - .../unit/Swift/Signers/SMimeSignerTest.php | 653 ------ .../ByteArrayReplacementFilterTest.php | 129 -- .../StringReplacementFilterFactoryTest.php | 36 - .../StringReplacementFilterTest.php | 59 - .../AbstractSmtpEventSupportTest.php | 558 ----- .../unit/Swift/Transport/AbstractSmtpTest.php | 1400 ------------- .../Esmtp/Auth/CramMd5AuthenticatorTest.php | 65 - .../Esmtp/Auth/LoginAuthenticatorTest.php | 65 - .../Esmtp/Auth/NTLMAuthenticatorTest.php | 204 -- .../Esmtp/Auth/PlainAuthenticatorTest.php | 68 - .../Swift/Transport/Esmtp/AuthHandlerTest.php | 165 -- .../EsmtpTransport/ExtensionSupportTest.php | 561 ----- .../Swift/Transport/EsmtpTransportTest.php | 651 ------ .../Swift/Transport/FailoverTransportTest.php | 600 ------ .../Transport/LoadBalancedTransportTest.php | 838 -------- .../Swift/Transport/SendmailTransportTest.php | 150 -- .../unit/Swift/Transport/StreamBufferTest.php | 43 - vendor/symfony/console/CHANGELOG.md | 32 +- vendor/symfony/console/ConsoleEvents.php | 6 +- .../Descriptor/ApplicationDescription.php | 2 +- .../console/Event/ConsoleCommandEvent.php | 2 +- .../Formatter/OutputFormatterStyle.php | 3 +- .../symfony/console/Input/InputArgument.php | 6 +- vendor/symfony/console/Input/InputOption.php | 8 +- vendor/symfony/console/Input/StringInput.php | 4 +- .../symfony/console/Logger/ConsoleLogger.php | 4 +- .../console/Output/OutputInterface.php | 16 +- vendor/symfony/console/Style/SymfonyStyle.php | 2 +- .../symfony/css-selector/Node/Specificity.php | 6 +- vendor/symfony/css-selector/Parser/Token.php | 14 +- .../XPath/Extension/NodeExtension.php | 6 +- vendor/symfony/debug/CHANGELOG.md | 49 +- .../ErrorRenderer/HtmlErrorRenderer.php | 6 +- vendor/symfony/finder/Finder.php | 6 +- .../Iterator/FileTypeFilterIterator.php | 4 +- .../finder/Iterator/SortableIterator.php | 14 +- vendor/symfony/http-foundation/Cookie.php | 6 +- .../symfony/http-foundation/JsonResponse.php | 16 +- vendor/symfony/http-foundation/Request.php | 48 +- vendor/symfony/http-foundation/Response.php | 128 +- .../http-foundation/ResponseHeaderBag.php | 8 +- .../Storage/Handler/PdoSessionHandler.php | 6 +- .../Session/Storage/MetadataBag.php | 6 +- vendor/symfony/http-foundation/composer.json | 3 +- .../DataCollector/DumpDataCollector.php | 2 + .../DataCollector/RequestDataCollector.php | 7 +- .../EventListener/AbstractSessionListener.php | 2 +- .../http-kernel/HttpKernelInterface.php | 4 +- vendor/symfony/http-kernel/Kernel.php | 21 +- vendor/symfony/http-kernel/KernelEvents.php | 16 +- vendor/symfony/mime/Email.php | 10 +- vendor/symfony/mime/Header/AbstractHeader.php | 2 +- .../mime/Header/ParameterizedHeader.php | 2 +- vendor/symfony/mime/MimeTypes.php | 3 +- vendor/symfony/mime/Part/TextPart.php | 2 +- .../Exception/ProcessTimedOutException.php | 4 +- .../symfony/process/Pipes/PipesInterface.php | 2 +- vendor/symfony/process/Process.php | 26 +- .../Generator/UrlGeneratorInterface.php | 8 +- .../symfony/routing/Loader/XmlFileLoader.php | 4 +- .../routing/Matcher/TraceableUrlMatcher.php | 6 +- vendor/symfony/routing/Matcher/UrlMatcher.php | 6 +- vendor/symfony/routing/RouteCompiler.php | 6 +- .../translation/DataCollectorTranslator.php | 6 +- .../translation/Extractor/PhpExtractor.php | 6 +- .../translation/Loader/MoFileLoader.php | 6 +- .../translation/MessageCatalogueInterface.php | 2 +- vendor/symfony/var-dumper/Caster/Caster.php | 26 +- .../var-dumper/Caster/ReflectionCaster.php | 2 +- vendor/symfony/var-dumper/Cloner/Cursor.php | 8 +- vendor/symfony/var-dumper/Cloner/Stub.php | 18 +- .../var-dumper/Dumper/AbstractDumper.php | 8 +- .../symfony/var-dumper/Dumper/CliDumper.php | 3 +- 342 files changed, 2055 insertions(+), 23814 deletions(-) create mode 100644 vendor/monolog/monolog/phpstan.neon.dist create mode 100644 vendor/nikic/php-parser/.github/workflows/main.yml create mode 100644 vendor/phpspec/prophecy/.github/workflows/build.yml delete mode 100644 vendor/swiftmailer/swiftmailer/phpunit.xml.dist delete mode 100644 vendor/swiftmailer/swiftmailer/tests/IdenticalBinaryConstraint.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/StreamCollector.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/SwiftMailerSmokeTestCase.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/SwiftMailerTestCase.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-2022-jp/one.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/iso-8859-1/one.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/one.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/three.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/charsets/utf-8/two.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.priv delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/dkim/dkim.test.pub delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/files/data.txt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/files/swiftmailer.png delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/files/textfile.zip delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/CA.srl delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.crt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/ca.key delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/create-cert.sh delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.crt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt.key delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.crt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/encrypt2.key delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.crt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/intermediate.key delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.crt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign.key delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.crt delete mode 100644 vendor/swiftmailer/swiftmailer/tests/_samples/smime/sign2.key delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance.conf.php.default delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/AttachmentAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/ByteStream/FileByteStreamAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Base64EncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bootstrap.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug518Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug534Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug650Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/fixtures/MimeEntityFixture.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/MessageTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/IdGeneratorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/AntiFloodPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/DKIMSignerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/OpenDKIMSignerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/SMimeSignerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php delete mode 100644 vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php diff --git a/composer.lock b/composer.lock index 523c26e66..f42836b88 100644 --- a/composer.lock +++ b/composer.lock @@ -1542,16 +1542,16 @@ }, { "name": "monolog/monolog", - "version": "1.25.5", + "version": "1.26.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0" + "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1817faadd1846cd08be9a49e905dc68823bc38c0", - "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/2209ddd84e7ef1256b7af205d0717fb62cfc9c33", + "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33", "shasum": "" }, "require": { @@ -1567,7 +1567,7 @@ "graylog2/gelf-php": "~1.0", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", - "php-parallel-lint/php-parallel-lint": "^1.0", + "phpstan/phpstan": "^0.12.59", "phpunit/phpunit": "~4.5", "ruflin/elastica": ">=0.90 <3.0", "sentry/sentry": "^0.13", @@ -1587,11 +1587,6 @@ "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "Monolog\\": "src/Monolog" @@ -1615,20 +1610,20 @@ "logging", "psr-3" ], - "time": "2020-07-23T08:35:51+00:00" + "time": "2020-12-14T12:56:38+00:00" }, { "name": "nesbot/carbon", - "version": "2.42.0", + "version": "2.43.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "d0463779663437392fe42ff339ebc0213bd55498" + "reference": "d32c57d8389113742f4a88725a170236470012e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d0463779663437392fe42ff339ebc0213bd55498", - "reference": "d0463779663437392fe42ff339ebc0213bd55498", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d32c57d8389113742f4a88725a170236470012e2", + "reference": "d32c57d8389113742f4a88725a170236470012e2", "shasum": "" }, "require": { @@ -1694,20 +1689,20 @@ "datetime", "time" ], - "time": "2020-11-28T14:25:28+00:00" + "time": "2020-12-17T20:55:32+00:00" }, { "name": "nikic/php-parser", - "version": "v4.10.3", + "version": "v4.10.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984" + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984", - "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", "shasum": "" }, "require": { @@ -1746,7 +1741,7 @@ "parser", "php" ], - "time": "2020-12-03T17:45:45+00:00" + "time": "2020-12-20T10:01:03+00:00" }, { "name": "opis/closure", @@ -2375,32 +2370,31 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v6.2.3", + "version": "v6.2.4", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "149cfdf118b169f7840bbe3ef0d4bc795d1780c9" + "reference": "56f0ab23f54c4ccbb0d5dcc67ff8552e0c98d59e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/149cfdf118b169f7840bbe3ef0d4bc795d1780c9", - "reference": "149cfdf118b169f7840bbe3ef0d4bc795d1780c9", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/56f0ab23f54c4ccbb0d5dcc67ff8552e0c98d59e", + "reference": "56f0ab23f54c4ccbb0d5dcc67ff8552e0c98d59e", "shasum": "" }, "require": { - "egulias/email-validator": "~2.0", + "egulias/email-validator": "^2.0", "php": ">=7.0.0", "symfony/polyfill-iconv": "^1.0", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8" + "mockery/mockery": "^1.0", + "symfony/phpunit-bridge": "^4.4|^5.0" }, "suggest": { - "ext-intl": "Needed to support internationalized email addresses", - "true/punycode": "Needed to support internationalized email addresses, if ext-intl is not installed" + "ext-intl": "Needed to support internationalized email addresses" }, "type": "library", "extra": { @@ -2433,20 +2427,20 @@ "mail", "mailer" ], - "time": "2019-11-12T09:31:26+00:00" + "time": "2020-12-08T18:02:06+00:00" }, { "name": "symfony/console", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c8e37f6928c19816437a4dd7bf16e3bd79941470" + "reference": "12e071278e396cc3e1c149857337e9e192deca0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c8e37f6928c19816437a4dd7bf16e3bd79941470", - "reference": "c8e37f6928c19816437a4dd7bf16e3bd79941470", + "url": "https://api.github.com/repos/symfony/console/zipball/12e071278e396cc3e1c149857337e9e192deca0b", + "reference": "12e071278e396cc3e1c149857337e9e192deca0b", "shasum": "" }, "require": { @@ -2505,20 +2499,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2020-11-28T10:15:42+00:00" + "time": "2020-12-18T07:41:31+00:00" }, { "name": "symfony/css-selector", - "version": "v5.2.0", + "version": "v5.2.1", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256" + "reference": "f789e7ead4c79e04ca9a6d6162fc629c89bd8054" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", - "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/f789e7ead4c79e04ca9a6d6162fc629c89bd8054", + "reference": "f789e7ead4c79e04ca9a6d6162fc629c89bd8054", "shasum": "" }, "require": { @@ -2553,20 +2547,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2020-10-28T21:31:18+00:00" + "time": "2020-12-08T17:02:38+00:00" }, { "name": "symfony/debug", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "65fe7b49868378319b82da3035fb30801b931c47" + "reference": "5dfc7825f3bfe9bb74b23d8b8ce0e0894e32b544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/65fe7b49868378319b82da3035fb30801b931c47", - "reference": "65fe7b49868378319b82da3035fb30801b931c47", + "url": "https://api.github.com/repos/symfony/debug/zipball/5dfc7825f3bfe9bb74b23d8b8ce0e0894e32b544", + "reference": "5dfc7825f3bfe9bb74b23d8b8ce0e0894e32b544", "shasum": "" }, "require": { @@ -2605,7 +2599,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2020-10-28T20:42:29+00:00" + "time": "2020-12-10T16:34:26+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2659,16 +2653,16 @@ }, { "name": "symfony/error-handler", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "b0887cf8fc692eef2a4cf11cee3c5f5eb93fcfdf" + "reference": "ef2f7ddd3b9177bbf8ff2ecd8d0e970ed48da0c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/b0887cf8fc692eef2a4cf11cee3c5f5eb93fcfdf", - "reference": "b0887cf8fc692eef2a4cf11cee3c5f5eb93fcfdf", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/ef2f7ddd3b9177bbf8ff2ecd8d0e970ed48da0c3", + "reference": "ef2f7ddd3b9177bbf8ff2ecd8d0e970ed48da0c3", "shasum": "" }, "require": { @@ -2707,20 +2701,20 @@ ], "description": "Symfony ErrorHandler Component", "homepage": "https://symfony.com", - "time": "2020-10-28T20:42:29+00:00" + "time": "2020-12-09T11:15:38+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "f029d6f21eac61ab23198e7aca40e7638e8c8924" + "reference": "5d4c874b0eb1c32d40328a09dbc37307a5a910b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f029d6f21eac61ab23198e7aca40e7638e8c8924", - "reference": "f029d6f21eac61ab23198e7aca40e7638e8c8924", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5d4c874b0eb1c32d40328a09dbc37307a5a910b0", + "reference": "5d4c874b0eb1c32d40328a09dbc37307a5a910b0", "shasum": "" }, "require": { @@ -2773,7 +2767,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2020-10-31T22:44:29+00:00" + "time": "2020-12-18T07:41:31+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2839,16 +2833,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9f1d1d883b79a91ef320c0c6e803494e042ef36e" + "reference": "ebd0965f2dc2d4e0f11487c16fbb041e50b5c09b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9f1d1d883b79a91ef320c0c6e803494e042ef36e", - "reference": "9f1d1d883b79a91ef320c0c6e803494e042ef36e", + "url": "https://api.github.com/repos/symfony/finder/zipball/ebd0965f2dc2d4e0f11487c16fbb041e50b5c09b", + "reference": "ebd0965f2dc2d4e0f11487c16fbb041e50b5c09b", "shasum": "" }, "require": { @@ -2879,7 +2873,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2020-11-17T19:45:34+00:00" + "time": "2020-12-08T16:59:59+00:00" }, { "name": "symfony/http-client-contracts", @@ -2945,22 +2939,23 @@ }, { "name": "symfony/http-foundation", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "9eeb37ec0ff3049c782ca67041648e28ddd75a94" + "reference": "5ebda66b51612516bf338d5f87da2f37ff74cf34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9eeb37ec0ff3049c782ca67041648e28ddd75a94", - "reference": "9eeb37ec0ff3049c782ca67041648e28ddd75a94", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5ebda66b51612516bf338d5f87da2f37ff74cf34", + "reference": "5ebda66b51612516bf338d5f87da2f37ff74cf34", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/mime": "^4.3|^5.0", - "symfony/polyfill-mbstring": "~1.1" + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.15" }, "require-dev": { "predis/predis": "~1.0", @@ -2991,20 +2986,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2020-11-03T11:58:18+00:00" + "time": "2020-12-18T07:41:31+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "9f5605ee05406d8afa40dc4f2954c6a61de3a984" + "reference": "eaff9a43e74513508867ecfa66ef94fbb96ab128" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9f5605ee05406d8afa40dc4f2954c6a61de3a984", - "reference": "9f5605ee05406d8afa40dc4f2954c6a61de3a984", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/eaff9a43e74513508867ecfa66ef94fbb96ab128", + "reference": "eaff9a43e74513508867ecfa66ef94fbb96ab128", "shasum": "" }, "require": { @@ -3078,20 +3073,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2020-11-29T09:23:08+00:00" + "time": "2020-12-18T13:32:33+00:00" }, { "name": "symfony/mime", - "version": "v5.2.0", + "version": "v5.2.1", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5" + "reference": "de97005aef7426ba008c46ba840fc301df577ada" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/05f667e8fa029568964fd3bec6bc17765b853cc5", - "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5", + "url": "https://api.github.com/repos/symfony/mime/zipball/de97005aef7426ba008c46ba840fc301df577ada", + "reference": "de97005aef7426ba008c46ba840fc301df577ada", "shasum": "" }, "require": { @@ -3141,7 +3136,7 @@ "mime", "mime-type" ], - "time": "2020-10-30T14:55:39+00:00" + "time": "2020-12-09T18:54:12+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3657,16 +3652,16 @@ }, { "name": "symfony/process", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "ec1482f13d53911a8a32e54ba6f9a3b43a57d943" + "reference": "075316ff72233ce3d04a9743414292e834f2cb4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/ec1482f13d53911a8a32e54ba6f9a3b43a57d943", - "reference": "ec1482f13d53911a8a32e54ba6f9a3b43a57d943", + "url": "https://api.github.com/repos/symfony/process/zipball/075316ff72233ce3d04a9743414292e834f2cb4a", + "reference": "075316ff72233ce3d04a9743414292e834f2cb4a", "shasum": "" }, "require": { @@ -3697,20 +3692,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2020-11-02T15:10:16+00:00" + "time": "2020-12-08T16:59:59+00:00" }, { "name": "symfony/routing", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "08712c5dd5041c03e997e13892f45884faccd868" + "reference": "80b042c20b035818daec844723e23b9825134ba0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/08712c5dd5041c03e997e13892f45884faccd868", - "reference": "08712c5dd5041c03e997e13892f45884faccd868", + "url": "https://api.github.com/repos/symfony/routing/zipball/80b042c20b035818daec844723e23b9825134ba0", + "reference": "80b042c20b035818daec844723e23b9825134ba0", "shasum": "" }, "require": { @@ -3768,7 +3763,7 @@ "uri", "url" ], - "time": "2020-11-24T13:31:32+00:00" + "time": "2020-12-08T16:59:59+00:00" }, { "name": "symfony/service-contracts", @@ -3834,16 +3829,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "84821e6a14a637e817f25d11147388695b6f790a" + "reference": "c1001b7d75b3136648f94b245588209d881c6939" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/84821e6a14a637e817f25d11147388695b6f790a", - "reference": "84821e6a14a637e817f25d11147388695b6f790a", + "url": "https://api.github.com/repos/symfony/translation/zipball/c1001b7d75b3136648f94b245588209d881c6939", + "reference": "c1001b7d75b3136648f94b245588209d881c6939", "shasum": "" }, "require": { @@ -3901,7 +3896,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2020-11-27T06:35:49+00:00" + "time": "2020-12-08T16:59:59+00:00" }, { "name": "symfony/translation-contracts", @@ -3966,16 +3961,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.17", + "version": "v4.4.18", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "65c6f1e848cda840ef7278686c8e30a7cc353c93" + "reference": "4f31364bbc8177f2a6dbc125ac3851634ebe2a03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/65c6f1e848cda840ef7278686c8e30a7cc353c93", - "reference": "65c6f1e848cda840ef7278686c8e30a7cc353c93", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/4f31364bbc8177f2a6dbc125ac3851634ebe2a03", + "reference": "4f31364bbc8177f2a6dbc125ac3851634ebe2a03", "shasum": "" }, "require": { @@ -4034,7 +4029,7 @@ "debug", "dump" ], - "time": "2020-11-24T09:55:37+00:00" + "time": "2020-12-08T16:59:59+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -4376,16 +4371,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.9.1", + "version": "v1.9.2", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" + "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e", + "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e", "shasum": "" }, "require": { @@ -4422,7 +4417,8 @@ "faker", "fixtures" ], - "time": "2019-12-12T13:22:17+00:00" + "abandoned": true, + "time": "2020-12-11T09:56:16+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -4898,16 +4894,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.12.1", + "version": "1.12.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d" + "reference": "245710e971a030f42e08f4912863805570f23d39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", + "reference": "245710e971a030f42e08f4912863805570f23d39", "shasum": "" }, "require": { @@ -4919,7 +4915,7 @@ }, "require-dev": { "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0 || ^9.0 <9.3" + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { @@ -4957,7 +4953,7 @@ "spy", "stub" ], - "time": "2020-09-29T09:10:42+00:00" + "time": "2020-12-19T10:15:11+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 5594d7454..4532aeba0 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -6,11 +6,11 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 1ae7b7740..eaac7b9d9 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -7,11 +7,11 @@ namespace Composer\Autoload; class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9 { public static $files = array ( + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index eb0d2baff..1b78a8b60 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -783,17 +783,17 @@ }, { "name": "fzaninotto/faker", - "version": "v1.9.1", - "version_normalized": "1.9.1.0", + "version": "v1.9.2", + "version_normalized": "1.9.2.0", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" + "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e", + "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e", "shasum": "" }, "require": { @@ -804,7 +804,7 @@ "phpunit/phpunit": "^4.8.35 || ^5.7", "squizlabs/php_codesniffer": "^2.9.2" }, - "time": "2019-12-12T13:22:17+00:00", + "time": "2020-12-11T09:56:16+00:00", "type": "library", "extra": { "branch-alias": { @@ -1933,17 +1933,17 @@ }, { "name": "monolog/monolog", - "version": "1.25.5", - "version_normalized": "1.25.5.0", + "version": "1.26.0", + "version_normalized": "1.26.0.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0" + "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1817faadd1846cd08be9a49e905dc68823bc38c0", - "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/2209ddd84e7ef1256b7af205d0717fb62cfc9c33", + "reference": "2209ddd84e7ef1256b7af205d0717fb62cfc9c33", "shasum": "" }, "require": { @@ -1959,7 +1959,7 @@ "graylog2/gelf-php": "~1.0", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", - "php-parallel-lint/php-parallel-lint": "^1.0", + "phpstan/phpstan": "^0.12.59", "phpunit/phpunit": "~4.5", "ruflin/elastica": ">=0.90 <3.0", "sentry/sentry": "^0.13", @@ -1978,13 +1978,8 @@ "ruflin/elastica": "Allow sending log messages to an Elastic Search server", "sentry/sentry": "Allow sending log messages to a Sentry server" }, - "time": "2020-07-23T08:35:51+00:00", + "time": "2020-12-14T12:56:38+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -2062,17 +2057,17 @@ }, { "name": "nesbot/carbon", - "version": "2.42.0", - "version_normalized": "2.42.0.0", + "version": "2.43.0", + "version_normalized": "2.43.0.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "d0463779663437392fe42ff339ebc0213bd55498" + "reference": "d32c57d8389113742f4a88725a170236470012e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d0463779663437392fe42ff339ebc0213bd55498", - "reference": "d0463779663437392fe42ff339ebc0213bd55498", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d32c57d8389113742f4a88725a170236470012e2", + "reference": "d32c57d8389113742f4a88725a170236470012e2", "shasum": "" }, "require": { @@ -2091,7 +2086,7 @@ "phpunit/phpunit": "^7.5 || ^8.0", "squizlabs/php_codesniffer": "^3.4" }, - "time": "2020-11-28T14:25:28+00:00", + "time": "2020-12-17T20:55:32+00:00", "bin": [ "bin/carbon" ], @@ -2143,17 +2138,17 @@ }, { "name": "nikic/php-parser", - "version": "v4.10.3", - "version_normalized": "4.10.3.0", + "version": "v4.10.4", + "version_normalized": "4.10.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984" + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984", - "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", "shasum": "" }, "require": { @@ -2164,7 +2159,7 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, - "time": "2020-12-03T17:45:45+00:00", + "time": "2020-12-20T10:01:03+00:00", "bin": [ "bin/php-parse" ], @@ -2688,17 +2683,17 @@ }, { "name": "phpspec/prophecy", - "version": "1.12.1", - "version_normalized": "1.12.1.0", + "version": "1.12.2", + "version_normalized": "1.12.2.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d" + "reference": "245710e971a030f42e08f4912863805570f23d39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", + "reference": "245710e971a030f42e08f4912863805570f23d39", "shasum": "" }, "require": { @@ -2710,9 +2705,9 @@ }, "require-dev": { "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0 || ^9.0 <9.3" + "phpunit/phpunit": "^8.0 || ^9.0" }, - "time": "2020-09-29T09:10:42+00:00", + "time": "2020-12-19T10:15:11+00:00", "type": "library", "extra": { "branch-alias": { @@ -4170,35 +4165,34 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v6.2.3", - "version_normalized": "6.2.3.0", + "version": "v6.2.4", + "version_normalized": "6.2.4.0", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "149cfdf118b169f7840bbe3ef0d4bc795d1780c9" + "reference": "56f0ab23f54c4ccbb0d5dcc67ff8552e0c98d59e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/149cfdf118b169f7840bbe3ef0d4bc795d1780c9", - "reference": "149cfdf118b169f7840bbe3ef0d4bc795d1780c9", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/56f0ab23f54c4ccbb0d5dcc67ff8552e0c98d59e", + "reference": "56f0ab23f54c4ccbb0d5dcc67ff8552e0c98d59e", "shasum": "" }, "require": { - "egulias/email-validator": "~2.0", + "egulias/email-validator": "^2.0", "php": ">=7.0.0", "symfony/polyfill-iconv": "^1.0", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8" + "mockery/mockery": "^1.0", + "symfony/phpunit-bridge": "^4.4|^5.0" }, "suggest": { - "ext-intl": "Needed to support internationalized email addresses", - "true/punycode": "Needed to support internationalized email addresses, if ext-intl is not installed" + "ext-intl": "Needed to support internationalized email addresses" }, - "time": "2019-11-12T09:31:26+00:00", + "time": "2020-12-08T18:02:06+00:00", "type": "library", "extra": { "branch-alias": { @@ -4234,17 +4228,17 @@ }, { "name": "symfony/console", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c8e37f6928c19816437a4dd7bf16e3bd79941470" + "reference": "12e071278e396cc3e1c149857337e9e192deca0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c8e37f6928c19816437a4dd7bf16e3bd79941470", - "reference": "c8e37f6928c19816437a4dd7bf16e3bd79941470", + "url": "https://api.github.com/repos/symfony/console/zipball/12e071278e396cc3e1c149857337e9e192deca0b", + "reference": "12e071278e396cc3e1c149857337e9e192deca0b", "shasum": "" }, "require": { @@ -4278,7 +4272,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2020-11-28T10:15:42+00:00", + "time": "2020-12-18T07:41:31+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4308,23 +4302,23 @@ }, { "name": "symfony/css-selector", - "version": "v5.2.0", - "version_normalized": "5.2.0.0", + "version": "v5.2.1", + "version_normalized": "5.2.1.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256" + "reference": "f789e7ead4c79e04ca9a6d6162fc629c89bd8054" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", - "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/f789e7ead4c79e04ca9a6d6162fc629c89bd8054", + "reference": "f789e7ead4c79e04ca9a6d6162fc629c89bd8054", "shasum": "" }, "require": { "php": ">=7.2.5" }, - "time": "2020-10-28T21:31:18+00:00", + "time": "2020-12-08T17:02:38+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4358,17 +4352,17 @@ }, { "name": "symfony/debug", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "65fe7b49868378319b82da3035fb30801b931c47" + "reference": "5dfc7825f3bfe9bb74b23d8b8ce0e0894e32b544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/65fe7b49868378319b82da3035fb30801b931c47", - "reference": "65fe7b49868378319b82da3035fb30801b931c47", + "url": "https://api.github.com/repos/symfony/debug/zipball/5dfc7825f3bfe9bb74b23d8b8ce0e0894e32b544", + "reference": "5dfc7825f3bfe9bb74b23d8b8ce0e0894e32b544", "shasum": "" }, "require": { @@ -4382,7 +4376,7 @@ "require-dev": { "symfony/http-kernel": "^3.4|^4.0|^5.0" }, - "time": "2020-10-28T20:42:29+00:00", + "time": "2020-12-10T16:34:26+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4464,17 +4458,17 @@ }, { "name": "symfony/error-handler", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "b0887cf8fc692eef2a4cf11cee3c5f5eb93fcfdf" + "reference": "ef2f7ddd3b9177bbf8ff2ecd8d0e970ed48da0c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/b0887cf8fc692eef2a4cf11cee3c5f5eb93fcfdf", - "reference": "b0887cf8fc692eef2a4cf11cee3c5f5eb93fcfdf", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/ef2f7ddd3b9177bbf8ff2ecd8d0e970ed48da0c3", + "reference": "ef2f7ddd3b9177bbf8ff2ecd8d0e970ed48da0c3", "shasum": "" }, "require": { @@ -4488,7 +4482,7 @@ "symfony/http-kernel": "^4.4|^5.0", "symfony/serializer": "^4.4|^5.0" }, - "time": "2020-10-28T20:42:29+00:00", + "time": "2020-12-09T11:15:38+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4518,17 +4512,17 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "f029d6f21eac61ab23198e7aca40e7638e8c8924" + "reference": "5d4c874b0eb1c32d40328a09dbc37307a5a910b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f029d6f21eac61ab23198e7aca40e7638e8c8924", - "reference": "f029d6f21eac61ab23198e7aca40e7638e8c8924", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5d4c874b0eb1c32d40328a09dbc37307a5a910b0", + "reference": "5d4c874b0eb1c32d40328a09dbc37307a5a910b0", "shasum": "" }, "require": { @@ -4556,7 +4550,7 @@ "symfony/dependency-injection": "", "symfony/http-kernel": "" }, - "time": "2020-10-31T22:44:29+00:00", + "time": "2020-12-18T07:41:31+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4650,23 +4644,23 @@ }, { "name": "symfony/finder", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9f1d1d883b79a91ef320c0c6e803494e042ef36e" + "reference": "ebd0965f2dc2d4e0f11487c16fbb041e50b5c09b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9f1d1d883b79a91ef320c0c6e803494e042ef36e", - "reference": "9f1d1d883b79a91ef320c0c6e803494e042ef36e", + "url": "https://api.github.com/repos/symfony/finder/zipball/ebd0965f2dc2d4e0f11487c16fbb041e50b5c09b", + "reference": "ebd0965f2dc2d4e0f11487c16fbb041e50b5c09b", "shasum": "" }, "require": { "php": ">=7.1.3" }, - "time": "2020-11-17T19:45:34+00:00", + "time": "2020-12-08T16:59:59+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4760,29 +4754,30 @@ }, { "name": "symfony/http-foundation", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "9eeb37ec0ff3049c782ca67041648e28ddd75a94" + "reference": "5ebda66b51612516bf338d5f87da2f37ff74cf34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9eeb37ec0ff3049c782ca67041648e28ddd75a94", - "reference": "9eeb37ec0ff3049c782ca67041648e28ddd75a94", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5ebda66b51612516bf338d5f87da2f37ff74cf34", + "reference": "5ebda66b51612516bf338d5f87da2f37ff74cf34", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/mime": "^4.3|^5.0", - "symfony/polyfill-mbstring": "~1.1" + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.15" }, "require-dev": { "predis/predis": "~1.0", "symfony/expression-language": "^3.4|^4.0|^5.0" }, - "time": "2020-11-03T11:58:18+00:00", + "time": "2020-12-18T07:41:31+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4812,17 +4807,17 @@ }, { "name": "symfony/http-kernel", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "9f5605ee05406d8afa40dc4f2954c6a61de3a984" + "reference": "eaff9a43e74513508867ecfa66ef94fbb96ab128" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9f5605ee05406d8afa40dc4f2954c6a61de3a984", - "reference": "9f5605ee05406d8afa40dc4f2954c6a61de3a984", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/eaff9a43e74513508867ecfa66ef94fbb96ab128", + "reference": "eaff9a43e74513508867ecfa66ef94fbb96ab128", "shasum": "" }, "require": { @@ -4871,7 +4866,7 @@ "symfony/console": "", "symfony/dependency-injection": "" }, - "time": "2020-11-29T09:23:08+00:00", + "time": "2020-12-18T13:32:33+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4901,17 +4896,17 @@ }, { "name": "symfony/mime", - "version": "v5.2.0", - "version_normalized": "5.2.0.0", + "version": "v5.2.1", + "version_normalized": "5.2.1.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5" + "reference": "de97005aef7426ba008c46ba840fc301df577ada" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/05f667e8fa029568964fd3bec6bc17765b853cc5", - "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5", + "url": "https://api.github.com/repos/symfony/mime/zipball/de97005aef7426ba008c46ba840fc301df577ada", + "reference": "de97005aef7426ba008c46ba840fc301df577ada", "shasum": "" }, "require": { @@ -4932,7 +4927,7 @@ "symfony/property-info": "^4.4|^5.1", "symfony/serializer": "^5.2" }, - "time": "2020-10-30T14:55:39+00:00", + "time": "2020-12-09T18:54:12+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5494,23 +5489,23 @@ }, { "name": "symfony/process", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "ec1482f13d53911a8a32e54ba6f9a3b43a57d943" + "reference": "075316ff72233ce3d04a9743414292e834f2cb4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/ec1482f13d53911a8a32e54ba6f9a3b43a57d943", - "reference": "ec1482f13d53911a8a32e54ba6f9a3b43a57d943", + "url": "https://api.github.com/repos/symfony/process/zipball/075316ff72233ce3d04a9743414292e834f2cb4a", + "reference": "075316ff72233ce3d04a9743414292e834f2cb4a", "shasum": "" }, "require": { "php": ">=7.1.3" }, - "time": "2020-11-02T15:10:16+00:00", + "time": "2020-12-08T16:59:59+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5540,17 +5535,17 @@ }, { "name": "symfony/routing", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "08712c5dd5041c03e997e13892f45884faccd868" + "reference": "80b042c20b035818daec844723e23b9825134ba0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/08712c5dd5041c03e997e13892f45884faccd868", - "reference": "08712c5dd5041c03e997e13892f45884faccd868", + "url": "https://api.github.com/repos/symfony/routing/zipball/80b042c20b035818daec844723e23b9825134ba0", + "reference": "80b042c20b035818daec844723e23b9825134ba0", "shasum": "" }, "require": { @@ -5577,7 +5572,7 @@ "symfony/http-foundation": "For using a Symfony Request object", "symfony/yaml": "For using the YAML loader" }, - "time": "2020-11-24T13:31:32+00:00", + "time": "2020-12-08T16:59:59+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5677,17 +5672,17 @@ }, { "name": "symfony/translation", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "84821e6a14a637e817f25d11147388695b6f790a" + "reference": "c1001b7d75b3136648f94b245588209d881c6939" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/84821e6a14a637e817f25d11147388695b6f790a", - "reference": "84821e6a14a637e817f25d11147388695b6f790a", + "url": "https://api.github.com/repos/symfony/translation/zipball/c1001b7d75b3136648f94b245588209d881c6939", + "reference": "c1001b7d75b3136648f94b245588209d881c6939", "shasum": "" }, "require": { @@ -5720,7 +5715,7 @@ "symfony/config": "", "symfony/yaml": "" }, - "time": "2020-11-27T06:35:49+00:00", + "time": "2020-12-08T16:59:59+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5813,17 +5808,17 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.17", - "version_normalized": "4.4.17.0", + "version": "v4.4.18", + "version_normalized": "4.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "65c6f1e848cda840ef7278686c8e30a7cc353c93" + "reference": "4f31364bbc8177f2a6dbc125ac3851634ebe2a03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/65c6f1e848cda840ef7278686c8e30a7cc353c93", - "reference": "65c6f1e848cda840ef7278686c8e30a7cc353c93", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/4f31364bbc8177f2a6dbc125ac3851634ebe2a03", + "reference": "4f31364bbc8177f2a6dbc125ac3851634ebe2a03", "shasum": "" }, "require": { @@ -5847,7 +5842,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2020-11-24T09:55:37+00:00", + "time": "2020-12-08T16:59:59+00:00", "bin": [ "Resources/bin/var-dump-server" ], diff --git a/vendor/fzaninotto/faker/src/Faker/Generator.php b/vendor/fzaninotto/faker/src/Faker/Generator.php index 7c757c379..1db2608ec 100644 --- a/vendor/fzaninotto/faker/src/Faker/Generator.php +++ b/vendor/fzaninotto/faker/src/Faker/Generator.php @@ -289,4 +289,9 @@ class Generator { $this->seed(); } + + public function __wakeup() + { + $this->formatters = []; + } } diff --git a/vendor/monolog/monolog/CHANGELOG.md b/vendor/monolog/monolog/CHANGELOG.md index 757643df9..53ee097b1 100644 --- a/vendor/monolog/monolog/CHANGELOG.md +++ b/vendor/monolog/monolog/CHANGELOG.md @@ -1,3 +1,7 @@ +### 1.26.0 (2020-12-14) + + * Added $dateFormat and $removeUsedContextFields arguments to PsrLogMessageProcessor (backport from 2.x) + ### 1.25.5 (2020-07-23) * Fixed array access on null in RavenHandler diff --git a/vendor/monolog/monolog/composer.json b/vendor/monolog/monolog/composer.json index e171e2029..d2deab7b8 100644 --- a/vendor/monolog/monolog/composer.json +++ b/vendor/monolog/monolog/composer.json @@ -26,7 +26,7 @@ "php-amqplib/php-amqplib": "~2.4", "swiftmailer/swiftmailer": "^5.3|^6.0", "php-console/php-console": "^3.1.3", - "php-parallel-lint/php-parallel-lint": "^1.0" + "phpstan/phpstan": "^0.12.59" }, "suggest": { "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", @@ -50,16 +50,9 @@ "provide": { "psr/log-implementation": "1.0.0" }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "scripts": { - "test": [ - "parallel-lint . --exclude vendor --exclude src/Monolog/Handler/FormattableHandlerInterface.php --exclude src/Monolog/Handler/FormattableHandlerTrait.php --exclude src/Monolog/Handler/ProcessableHandlerInterface.php --exclude src/Monolog/Handler/ProcessableHandlerTrait.php", - "phpunit" - ] + "test": "vendor/bin/phpunit", + "phpstan": "vendor/bin/phpstan analyse" }, "lock": false } diff --git a/vendor/monolog/monolog/phpstan.neon.dist b/vendor/monolog/monolog/phpstan.neon.dist new file mode 100644 index 000000000..1fe45df73 --- /dev/null +++ b/vendor/monolog/monolog/phpstan.neon.dist @@ -0,0 +1,16 @@ +parameters: + level: 3 + + paths: + - src/ +# - tests/ + + + ignoreErrors: + - '#zend_monitor_|ZEND_MONITOR_#' + - '#RollbarNotifier#' + - '#Predis\\Client#' + - '#^Cannot call method ltrim\(\) on int\|false.$#' + - '#^Access to an undefined property Raven_Client::\$context.$#' + - '#MongoDB\\(Client|Collection)#' + - '#Gelf\\IMessagePublisher#' diff --git a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php index 36ec0098f..5121c2cd0 100644 --- a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +++ b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php @@ -62,6 +62,7 @@ class ErrorHandler //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929 class_exists('\\Psr\\Log\\LogLevel', true); + /** @phpstan-ignore-next-line */ $handler = new static($logger); if ($errorLevelMap !== false) { $handler->registerErrorHandler($errorLevelMap); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php index 237b71f61..8846e0a08 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php @@ -77,6 +77,7 @@ class DynamoDbHandler extends AbstractProcessingHandler if ($this->version === 3) { $formatted = $this->marshaler->marshalItem($filtered); } else { + /** @phpstan-ignore-next-line */ $formatted = $this->client->formatAttributes($filtered); } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php index c30b1843c..2a171bd82 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php @@ -72,7 +72,7 @@ class FirePHPHandler extends AbstractProcessingHandler * * @see createHeader() * @param array $record - * @return string + * @return array */ protected function createRecordHeader(array $record) { diff --git a/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php index 71e466934..b6cde7c65 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php @@ -27,7 +27,7 @@ use Monolog\Formatter\GelfMessageFormatter; class GelfHandler extends AbstractProcessingHandler { /** - * @var Publisher the publisher object that sends the message to the server + * @var Publisher|PublisherInterface|IMessagePublisher the publisher object that sends the message to the server */ protected $publisher; diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php index 179d62686..30258e36e 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php @@ -270,10 +270,10 @@ class HipChatHandler extends SocketHandler * will be the highest level from the given records. Datetime will be taken * from the first record. * - * @param $records + * @param array $records * @return array */ - private function combineRecords($records) + private function combineRecords(array $records) { $batchRecord = null; $batchRecords = array(); diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php index 9d24dfe86..b0298fa6c 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php @@ -50,7 +50,7 @@ class RavenHandler extends AbstractProcessingHandler protected $ravenClient; /** - * @var LineFormatter The formatter to use for the logs generated via handleBatch() + * @var FormatterInterface The formatter to use for the logs generated via handleBatch() */ protected $batchFormatter; diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php index bb00db509..3725db242 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php @@ -36,7 +36,7 @@ class RedisHandler extends AbstractProcessingHandler * @param string $key The key name to push records to * @param int $level The minimum logging level at which this handler will be triggered * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param int $capSize Number of entries to limit list size to + * @param int|false $capSize Number of entries to limit list size to */ public function __construct($redis, $key, $level = Logger::DEBUG, $bubble = true, $capSize = false) { diff --git a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php index b52607d2e..ad6960cb2 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php @@ -154,7 +154,7 @@ class StreamHandler extends AbstractProcessingHandler return dirname(substr($stream, 7)); } - return; + return null; } private function createDir() diff --git a/vendor/monolog/monolog/src/Monolog/Logger.php b/vendor/monolog/monolog/src/Monolog/Logger.php index e649af51b..b8b4f55b4 100644 --- a/vendor/monolog/monolog/src/Monolog/Logger.php +++ b/vendor/monolog/monolog/src/Monolog/Logger.php @@ -522,7 +522,7 @@ class Logger implements LoggerInterface, ResettableInterface /** * Converts PSR-3 levels to Monolog ones if necessary * - * @param string|int Level number (monolog) or name (PSR-3) + * @param string|int $level Level number (monolog) or name (PSR-3) * @return int */ public static function toMonologLevel($level) diff --git a/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php index 008850545..a318af7e4 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php @@ -22,6 +22,24 @@ use Monolog\Utils; */ class PsrLogMessageProcessor implements ProcessorInterface { + const SIMPLE_DATE = "Y-m-d\TH:i:s.uP"; + + /** @var string|null */ + private $dateFormat; + + /** @var bool */ + private $removeUsedContextFields; + + /** + * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format + * @param bool $removeUsedContextFields If set to true the fields interpolated into message gets unset + */ + public function __construct($dateFormat = null, $removeUsedContextFields = false) + { + $this->dateFormat = $dateFormat; + $this->removeUsedContextFields = $removeUsedContextFields; + } + /** * @param array $record * @return array @@ -34,12 +52,25 @@ class PsrLogMessageProcessor implements ProcessorInterface $replacements = array(); foreach ($record['context'] as $key => $val) { + $placeholder = '{' . $key . '}'; + if (strpos($record['message'], $placeholder) === false) { + continue; + } + if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) { - $replacements['{'.$key.'}'] = $val; + $replacements[$placeholder] = $val; + } elseif ($val instanceof \DateTime) { + $replacements[$placeholder] = $val->format($this->dateFormat ?: static::SIMPLE_DATE); } elseif (is_object($val)) { - $replacements['{'.$key.'}'] = '[object '.Utils::getClass($val).']'; + $replacements[$placeholder] = '[object '.Utils::getClass($val).']'; + } elseif (is_array($val)) { + $replacements[$placeholder] = 'array'.Utils::jsonEncode($val, null, true); } else { - $replacements['{'.$key.'}'] = '['.gettype($val).']'; + $replacements[$placeholder] = '['.gettype($val).']'; + } + + if ($this->removeUsedContextFields) { + unset($record['context'][$key]); } } diff --git a/vendor/monolog/monolog/src/Monolog/Utils.php b/vendor/monolog/monolog/src/Monolog/Utils.php index 712b19692..7f1ba129e 100644 --- a/vendor/monolog/monolog/src/Monolog/Utils.php +++ b/vendor/monolog/monolog/src/Monolog/Utils.php @@ -168,7 +168,7 @@ class Utils * Function converts the input in place in the passed variable so that it * can be used as a callback for array_walk_recursive. * - * @param mixed &$data Input to check and convert if needed + * @param mixed $data Input to check and convert if needed, passed by ref * @private */ public static function detectAndCleanUtf8(&$data) diff --git a/vendor/nesbot/carbon/composer.json b/vendor/nesbot/carbon/composer.json index 3d8002aaf..0fe60311c 100644 --- a/vendor/nesbot/carbon/composer.json +++ b/vendor/nesbot/carbon/composer.json @@ -49,6 +49,9 @@ } }, "autoload-dev": { + "files": [ + "tests/Laravel/ServiceProvider.php" + ], "psr-4": { "Tests\\": "tests/" } diff --git a/vendor/nesbot/carbon/readme.md b/vendor/nesbot/carbon/readme.md index 2aab4b623..4ae35ab69 100644 --- a/vendor/nesbot/carbon/readme.md +++ b/vendor/nesbot/carbon/readme.md @@ -2,7 +2,7 @@ [![Latest Stable Version](https://img.shields.io/packagist/v/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) [![Total Downloads](https://img.shields.io/packagist/dt/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) -[![Build Status](https://img.shields.io/travis/briannesbitt/Carbon/master.svg?style=flat-square)](https://travis-ci.org/briannesbitt/Carbon) +[![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fbriannesbitt%2FCarbon%2Fbadge&style=flat-square&label=Build&logo=none)](https://actions-badge.atrox.dev/briannesbitt/Carbon/goto) [![StyleCI](https://github.styleci.io/repos/5724990/shield?style=flat-square)](https://github.styleci.io/repos/5724990) [![codecov.io](https://img.shields.io/codecov/c/github/briannesbitt/Carbon.svg?style=flat-square)](https://codecov.io/github/briannesbitt/Carbon?branch=master) [![PHPStan](https://img.shields.io/badge/PHPStan-enabled-44CC11.svg?longCache=true&style=flat-square)](https://github.com/phpstan/phpstan) diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php index 8cb60cedf..ab0029103 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php @@ -583,7 +583,13 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface $interval = new static(0); $localStrictModeEnabled = $interval->localStrictModeEnabled; $interval->localStrictModeEnabled = true; - $result = $interval->$method(...$parameters); + + $result = static::hasMacro($method) + ? static::bindMacroContext(null, function () use (&$method, &$parameters, &$interval) { + return $interval->callMacro($method, $parameters); + }) + : $interval->$method(...$parameters); + $interval->localStrictModeEnabled = $localStrictModeEnabled; return $result; @@ -596,6 +602,16 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface } } + /** + * Return the current context from inside a macro callee or a new one if static. + * + * @return static + */ + protected static function this() + { + return end(static::$macroContextStack) ?: new static(0); + } + /** * Creates a CarbonInterval from string. * @@ -811,7 +827,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface } if ($interval instanceof self && is_a($className, self::class, true)) { - $instance->setStep($interval->getStep()); + static::copyStep($interval, $instance); } static::copyNegativeUnits($interval, $instance); @@ -819,7 +835,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface return $instance; } - private static function copyNegativeUnits(DateInterval $from, DateInterval $to) + private static function copyNegativeUnits(DateInterval $from, DateInterval $to): void { $to->invert = $from->invert; @@ -830,6 +846,11 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface } } + private static function copyStep(self $from, self $to): void + { + $to->setStep($from->getStep()); + } + /** * Cast the current instance into the given class. * @@ -1228,10 +1249,10 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface if ($macro instanceof Closure) { $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); - return \call_user_func_array($boundMacro ?: $macro, $parameters); + return ($boundMacro ?: $macro)(...$parameters); } - return \call_user_func_array($macro, $parameters); + return $macro(...$parameters); } /** diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php index 53a54d1b8..d9d44cf41 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php @@ -174,43 +174,43 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @var string */ - const RECURRENCES_FILTER = 'Carbon\CarbonPeriod::filterRecurrences'; - const END_DATE_FILTER = 'Carbon\CarbonPeriod::filterEndDate'; + public const RECURRENCES_FILTER = [self::class, 'filterRecurrences']; + public const END_DATE_FILTER = [self::class, 'filterEndDate']; /** * Special value which can be returned by filters to end iteration. Also a filter. * * @var string */ - const END_ITERATION = 'Carbon\CarbonPeriod::endIteration'; + public const END_ITERATION = [self::class, 'endIteration']; /** * Exclude start date from iteration. * * @var int */ - const EXCLUDE_START_DATE = 1; + public const EXCLUDE_START_DATE = 1; /** * Exclude end date from iteration. * * @var int */ - const EXCLUDE_END_DATE = 2; + public const EXCLUDE_END_DATE = 2; /** * Yield CarbonImmutable instances. * * @var int */ - const IMMUTABLE = 4; + public const IMMUTABLE = 4; /** * Number of maximum attempts before giving up on finding next valid date. * * @var int */ - const NEXT_MAX_ATTEMPTS = 1000; + public const NEXT_MAX_ATTEMPTS = 1000; /** * The registered macros. @@ -583,7 +583,15 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable */ public static function __callStatic($method, $parameters) { - return (new static)->$method(...$parameters); + $date = new static(); + + if (static::hasMacro($method)) { + return static::bindMacroContext(null, function () use (&$method, &$parameters, &$date) { + return $date->callMacro($method, $parameters); + }); + } + + return $date->$method(...$parameters); } /** @@ -1212,7 +1220,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable */ public function setStartDate($date, $inclusive = null) { - if (!$date = \call_user_func([$this->dateClass, 'make'], $date)) { + if (!$date = ([$this->dateClass, 'make'])($date)) { throw new InvalidPeriodDateException('Invalid start date.'); } @@ -1237,7 +1245,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable */ public function setEndDate($date, $inclusive = null) { - if (!\is_null($date) && !$date = \call_user_func([$this->dateClass, 'make'], $date)) { + if (!\is_null($date) && !$date = ([$this->dateClass, 'make'])($date)) { throw new InvalidPeriodDateException('Invalid end date.'); } @@ -1330,7 +1338,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable public function rewind() { $this->key = 0; - $this->current = \call_user_func([$this->dateClass, 'make'], $this->startDate); + $this->current = ([$this->dateClass, 'make'])($this->startDate); $settings = $this->getSettings(); if ($this->hasLocalTranslator()) { @@ -1398,7 +1406,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable */ public function toString() { - $translator = \call_user_func([$this->dateClass, 'getTranslator']); + $translator = ([$this->dateClass, 'getTranslator'])(); $parts = []; @@ -1490,11 +1498,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable $result = iterator_to_array($this); - [ - $this->key, - $this->current, - $this->validationResult - ] = $state; + [$this->key, $this->current, $this->validationResult] = $state; return $result; } @@ -1637,9 +1641,10 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable case 'minute': case 'seconds': case 'second': - return $this->setDateInterval(\call_user_func( + return $this->setDateInterval(( // Override default P1D when instantiating via fluent setters. - [$this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method], + [$this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method] + )( \count($parameters) === 0 ? 1 : $first )); } @@ -2173,7 +2178,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable } return [function ($date) use ($method, $parameters) { - return \call_user_func_array([$date, $method], $parameters); + return ([$date, $method])(...$parameters); }, $method]; } @@ -2187,7 +2192,8 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable */ protected function isCarbonPredicateMethod($callable) { - return \is_string($callable) && substr($callable, 0, 2) === 'is' && (method_exists($this->dateClass, $callable) || \call_user_func([$this->dateClass, 'hasMacro'], $callable)); + return \is_string($callable) && substr($callable, 0, 2) === 'is' && + (method_exists($this->dateClass, $callable) || ([$this->dateClass, 'hasMacro'])($callable)); } /** @@ -2313,7 +2319,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable */ protected function prepareForReturn(CarbonInterface $date) { - $date = \call_user_func([$this->dateClass, 'make'], $date); + $date = ([$this->dateClass, 'make'])($date); if ($this->timezone) { $date = $date->setTimezone($this->timezone); @@ -2359,10 +2365,10 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable if ($macro instanceof Closure) { $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); - return \call_user_func_array($boundMacro ?: $macro, $parameters); + return ($boundMacro ?: $macro)(...$parameters); } - return \call_user_func_array($macro, $parameters); + return $macro(...$parameters); } /** diff --git a/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php b/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php index 2078c3d69..d53b1f499 100644 --- a/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php +++ b/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php @@ -4,7 +4,7 @@ namespace Carbon\Cli; class Invoker { - const CLI_CLASS_NAME = 'Carbon\\Cli'; + public const CLI_CLASS_NAME = 'Carbon\\Cli'; protected function runWithCli(string $className, array $parameters): bool { diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php index 1c3783053..fc69ff332 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php @@ -35,7 +35,7 @@ trait CarbonTypeConverter return preg_replace('/\(\d+\)/', "($precision)", $type); } - list($before, $after) = explode(' ', "$type "); + [$before, $after] = explode(' ', "$type "); return trim("$before($precision) $after"); } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/vendor/nesbot/carbon/src/Carbon/Traits/Date.php index dece39dc8..751618030 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Date.php @@ -2295,10 +2295,10 @@ trait Date if ($macro instanceof Closure) { $boundMacro = @Closure::bind($macro, null, static::class); - return \call_user_func_array($boundMacro ?: $macro, $parameters); + return ($boundMacro ?: $macro)(...$parameters); } - return \call_user_func_array($macro, $parameters); + return $macro(...$parameters); }); } @@ -2412,10 +2412,10 @@ trait Date if ($macro instanceof Closure) { $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); - return \call_user_func_array($boundMacro ?: $macro, $parameters); + return ($boundMacro ?: $macro)(...$parameters); } - return \call_user_func_array($macro, $parameters); + return $macro(...$parameters); } protected function executeCallableWithContext($macro, ...$parameters) diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php b/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php index 6988e2507..73a96cbe4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php @@ -495,8 +495,15 @@ trait Difference public function floatDiffInDays($date = null, $absolute = true) { $hoursDiff = $this->floatDiffInHours($date, $absolute); + $interval = $this->diff($date, $absolute); - return ($hoursDiff < 0 ? -1 : 1) * $this->diffInDays($date) + fmod($hoursDiff, static::HOURS_PER_DAY) / static::HOURS_PER_DAY; + if ($interval->y === 0 && $interval->m === 0 && $interval->d === 0) { + return $hoursDiff / static::HOURS_PER_DAY; + } + + $daysDiff = (int) $interval->format('%r%a'); + + return $daysDiff + fmod($hoursDiff, static::HOURS_PER_DAY) / static::HOURS_PER_DAY; } /** diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php index bd7f5b61d..827d7b47f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php @@ -535,7 +535,7 @@ trait Localization public static function executeWithLocale($locale, $func) { $currentLocale = static::getLocale(); - $result = \call_user_func($func, static::setLocale($locale) ? static::getLocale() : false, static::translator()); + $result = $func(static::setLocale($locale) ? static::getLocale() : false, static::translator()); static::setLocale($currentLocale); return $result; diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php b/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php index b5d07069f..b81f28dad 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php @@ -164,6 +164,16 @@ trait Mixin return $result; } + /** + * Return the current context from inside a macro callee or a null if static. + * + * @return static|null + */ + protected static function context() + { + return end(static::$macroContextStack) ?: null; + } + /** * Return the current context from inside a macro callee or a new one if static. * diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php index 32d309b83..e9d907572 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php @@ -92,7 +92,9 @@ trait Rounding $factor /= $delta; $fraction *= $delta; $arguments[0] += $this->$unit * $factor; - $changes[$unit] = round($minimum + ($fraction ? $fraction * \call_user_func($function, ($this->$unit - $minimum) / $fraction) : 0)); + $changes[$unit] = round( + $minimum + ($fraction ? $fraction * $function(($this->$unit - $minimum) / $fraction) : 0) + ); // Cannot use modulo as it lose double precision while ($changes[$unit] >= $delta) { @@ -105,7 +107,9 @@ trait Rounding [$value, $minimum] = $arguments; /** @var CarbonInterface $result */ - $result = $this->$normalizedUnit(floor(\call_user_func($function, ($value - $minimum) / $precision) * $precision + $minimum)); + $result = $this->$normalizedUnit( + floor($function(($value - $minimum) / $precision) * $precision + $minimum) + ); foreach ($changes as $unit => $value) { $result = $result->$unit($value); diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php index c1d64977d..6b8d660c7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php @@ -149,10 +149,11 @@ trait Serialization public function jsonSerialize() { $serializer = $this->localSerializer ?? static::$serializer; + if ($serializer) { return \is_string($serializer) ? $this->rawFormat($serializer) - : \call_user_func($serializer, $this); + : $serializer($this); } return $this->toJSON(); diff --git a/vendor/nikic/php-parser/.github/workflows/main.yml b/vendor/nikic/php-parser/.github/workflows/main.yml new file mode 100644 index 000000000..426d4c83d --- /dev/null +++ b/vendor/nikic/php-parser/.github/workflows/main.yml @@ -0,0 +1,86 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions +name: Main +on: + push: + pull_request: + +jobs: + tests_70: + runs-on: "ubuntu-latest" + name: "PHP 7.0 Unit Tests" + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "xdebug" + php-version: "7.0" + tools: composer:v2 + - name: "Install dependencies" + run: | + composer require php-coveralls/php-coveralls:^2.2 --dev --no-update + composer update --no-progress --prefer-dist + - name: "Tests" + run: "php vendor/bin/phpunit --coverage-clover build/logs/clover.xml" + - name: Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: "php vendor/bin/php-coveralls" + if: ${{ success() }} + tests: + runs-on: "ubuntu-latest" + name: "PHP ${{ matrix.php-version }} Unit Tests" + strategy: + matrix: + php-version: + - "7.1" + - "7.2" + - "7.3" + - "7.4" + - "8.0" + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + tools: composer:v2 + - name: "Install dependencies" + run: "composer update --no-progress --prefer-dist" + - name: "PHPUnit" + run: "php vendor/bin/phpunit" + test_old_73_80: + runs-on: "ubuntu-latest" + name: "PHP 7.3 Code on PHP 8.0 Integration Tests" + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "8.0" + tools: composer:v2 + - name: "Install PHP 8 dependencies" + run: "composer update --no-progress --prefer-dist" + - name: "Tests" + run: "test_old/run-php-src.sh 7.3.21" + test_old_80_70: + runs-on: "ubuntu-latest" + name: "PHP 8.0 Code on PHP 7.0 Integration Tests" + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "7.0" + tools: composer:v2 + - name: "Install PHP 8 dependencies" + run: "composer update --no-progress --prefer-dist" + - name: "Tests" + run: "test_old/run-php-src.sh 8.0.0" diff --git a/vendor/nikic/php-parser/README.md b/vendor/nikic/php-parser/README.md index 8455faa78..4c8deada9 100644 --- a/vendor/nikic/php-parser/README.md +++ b/vendor/nikic/php-parser/README.md @@ -1,7 +1,7 @@ PHP Parser ========== -[![Build Status](https://travis-ci.org/nikic/PHP-Parser.svg?branch=master)](https://travis-ci.org/nikic/PHP-Parser) [![Coverage Status](https://coveralls.io/repos/github/nikic/PHP-Parser/badge.svg?branch=master)](https://coveralls.io/github/nikic/PHP-Parser?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/nikic/PHP-Parser/badge.svg?branch=master)](https://coveralls.io/github/nikic/PHP-Parser?branch=master) This is a PHP 5.2 to PHP 8.0 parser written in PHP. Its purpose is to simplify static code analysis and manipulation. diff --git a/vendor/nikic/php-parser/grammar/php7.y b/vendor/nikic/php-parser/grammar/php7.y index 8add78338..4ca244d8a 100644 --- a/vendor/nikic/php-parser/grammar/php7.y +++ b/vendor/nikic/php-parser/grammar/php7.y @@ -348,10 +348,7 @@ function_declaration_statement: ; class_declaration_statement: - class_entry_type identifier extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$2, ['type' => $1, 'extends' => $3, 'implements' => $4, 'stmts' => $6, 'attrGroups' => []]]; - $this->checkClass($$, #2); } - | attributes class_entry_type identifier extends_from implements_list '{' class_statement_list '}' + optional_attributes class_entry_type identifier extends_from implements_list '{' class_statement_list '}' { $$ = Stmt\Class_[$3, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; $this->checkClass($$, #3); } | optional_attributes T_INTERFACE identifier interface_extends_list '{' class_statement_list '}' @@ -601,7 +598,7 @@ non_empty_global_var_list: ; global_var: - simple_variable { $$ = Expr\Variable[$1]; } + simple_variable { $$ = $1; } ; static_var_list: @@ -1007,7 +1004,7 @@ callable_expr: ; callable_variable: - simple_variable { $$ = Expr\Variable[$1]; } + simple_variable { $$ = $1; } | array_object_dereferencable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } | array_object_dereferencable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } | function_call { $$ = $1; } @@ -1032,15 +1029,15 @@ variable: ; simple_variable: - T_VARIABLE { $$ = parseVar($1); } - | '$' '{' expr '}' { $$ = $3; } + plain_variable { $$ = $1; } + | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } | '$' simple_variable { $$ = Expr\Variable[$2]; } - | '$' error { $$ = Expr\Error[]; $this->errorState = 2; } + | '$' error { $$ = Expr\Variable[Expr\Error[]]; $this->errorState = 2; } ; static_member_prop_name: simple_variable - { $var = $1; $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } + { $var = $1->name; $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } ; static_member: @@ -1049,7 +1046,7 @@ static_member: ; new_variable: - simple_variable { $$ = Expr\Variable[$1]; } + simple_variable { $$ = $1; } | new_variable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } | new_variable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } | new_variable T_OBJECT_OPERATOR property_name { $$ = Expr\PropertyFetch[$1, $3]; } @@ -1063,13 +1060,13 @@ new_variable: member_name: identifier_ex { $$ = $1; } | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = Expr\Variable[$1]; } + | simple_variable { $$ = $1; } ; property_name: identifier { $$ = $1; } | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = Expr\Variable[$1]; } + | simple_variable { $$ = $1; } | error { $$ = Expr\Error[]; $this->errorState = 2; } ; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php index cbfbd34aa..55d16585b 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php @@ -19,7 +19,7 @@ class Php7 extends \PhpParser\ParserAbstract { protected $tokenToSymbolMapSize = 392; protected $actionTableSize = 1162; - protected $gotoTableSize = 611; + protected $gotoTableSize = 588; protected $invalidSymbol = 165; protected $errorSymbol = 1; @@ -27,7 +27,7 @@ class Php7 extends \PhpParser\ParserAbstract protected $unexpectedTokenRule = 32767; protected $YY2TBLSTATE = 397; - protected $numNonLeafStates = 694; + protected $numNonLeafStates = 688; protected $symbolToName = array( "EOF", @@ -241,249 +241,249 @@ class Php7 extends \PhpParser\ParserAbstract ); protected $action = array( - 130, 131, 132, 555, 133, 134,-32766, 704, 705, 706, - 135, 36, -543, -552, 455,-32766, -543,-32766,-32766,-32766, - -552, 1152, 778, 927, -549, 969, 970, 0,-32766,-32766, - -32766, -549,-32766, 1219,-32766, 245,-32766, 962,-32766,-32766, - -32766,-32766,-32766, 461,-32766,-32766,-32766,-32766,-32766,-32766, - -32766,-32766, 124, -331, 707, -331,-32766, 388, 1031, 1032, - 1033, 1030, 1029, 1028,-32766, 435, 430, 2, 261, 136, - 371, 711, 712, 713, 714, 391, 789, 397, 1031, 1032, - 1033, 1030, 1029, 1028, 715, 716, 717, 718, 719, 720, - 721, 722, 723, 724, 725, 745, 556, 746, 747, 748, - 749, 737, 738, 372, 373, 740, 741, 726, 727, 728, - 730, 731, 732, 332, 771, 772, 773, 774, 775, 733, - 734, 557, 558, 766, 757, 755, 756, 752, 753, -294, - -189, 559, 560, 751, 561, 562, 563, 564, 565, 566, - 1235, 456, 783, -503, 889, 754, 567, 568, 928, 137, - -32766,-32766,-32766, 130, 131, 132, 555, 133, 134, 983, - 704, 705, 706, 135, 36,-32766,-32766,-32766,-32766, -552, - -32766,-32766,-32766, -552, 1152, 547, 101, 102, 103, 583, - -549,-32766,-32766,-32766, -549,-32766,-32766,-32766, 245,-32766, - 80,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32766, - 959, 958, 957,-32766,-32766, -503, -503, 707, 1264,-32766, - 388, 1265,-32766,-32766,-32766, 235, 784,-32766, 778, 19, - -503, 261, 136, 371, 711, 712, 713, 714,-32766,-32766, - 397, 788, -503,-32766, -509,-32766,-32766, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 745, 556, - 746, 747, 748, 749, 737, 738, 372, 373, 740, 741, - 726, 727, 728, 730, 731, 732, 332, 771, 772, 773, - 774, 775, 733, 734, 557, 558, 766, 757, 755, 756, - 752, 753, -294, -189, 559, 560, 751, 561, 562, 563, - 564, 565, 566, 309, 81, 82, 83, 139, 754, 567, - 568, 681, 137, 729, 699, 700, 701, 702, 703, 1239, - 704, 705, 706, 742, 743, 33, 1238, 84, 85, 86, + 130, 131, 132, 552, 133, 134, 0, 698, 699, 700, + 135, 36, 883, 528, 529,-32766, 1212,-32766,-32766,-32766, + -551, 1145, 772, 889, 430, 431, 1232, -551,-32766,-32766, + -32766, -293,-32766, 1231,-32766, 245,-32766, -189,-32766,-32766, + -32766,-32766,-32766, 458,-32766,-32766,-32766,-32766,-32766,-32766, + -32766,-32766, 124, 783, 701, 777,-32766, 388, 1024, 1025, + 1026, 1023, 1022, 1021,-32766, 428, 429, 955, 261, 136, + 372, 705, 706, 707, 708, 391, -188, 397, 1024, 1025, + 1026, 1023, 1022, 1021, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 739, 553, 740, 741, 742, + 743, 731, 732, 373, 374, 734, 735, 720, 721, 722, + 724, 725, 726, 333, 765, 766, 767, 768, 769, 727, + 728, 554, 555, 760, 751, 749, 750, 746, 747, 778, + 2, 556, 557, 745, 558, 559, 560, 561, 562, 563, + -542, -548, 19, -502, -542, 748, 564, 565, -548, 137, + -32766,-32766,-32766, 130, 131, 132, 552, 133, 134, 976, + 698, 699, 700, 135, 36,-32766,-32766,-32766,-32766, 675, + -32766,-32766,-32766, 80, 1145, 544, -551,-32766,-32766, 309, + -551,-32766,-32766,-32766, -293,-32766,-32766,-32766, 245,-32766, + -189,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32766, + 31, 433, 429,-32766,-32766, -502, -502, 701, 782,-32766, + 388, 391,-32766,-32766,-32766, 235, 126,-32766, -82, 142, + -502, 261, 136, 372, 705, 706, 707, 708, 247, -188, + 397, 292, -502,-32766, -508,-32766,-32766, 709, 710, 711, + 712, 713, 714, 715, 716, 717, 718, 719, 739, 553, + 740, 741, 742, 743, 731, 732, 373, 374, 734, 735, + 720, 721, 722, 724, 725, 726, 333, 765, 766, 767, + 768, 769, 727, 728, 554, 555, 760, 751, 749, 750, + 746, 747, 294, -82, 556, 557, 745, 558, 559, 560, + 561, 562, 563, 310, 81, 82, 83, -548, 748, 564, + 565, -548, 137, 723, 693, 694, 695, 696, 697,-32766, + 698, 699, 700, 736, 737, 33, 307, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 31, 263,-32766,-32766,-32766, 104, 105, 106, 577, 263, - 1216, 126, -188, 107, 142, 440, 441, 707,-32766,-32766, - -32766, 107, -254,-32766, 247,-32766,-32766,-32766,-32766,-32766, - -32766, 708, 709, 710, 711, 712, 713, 714, 293,-32766, - 776,-32766,-32766,-32766,-32766,-32766, 295, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 745, 768, - 746, 747, 748, 749, 737, 738, 739, 767, 740, 741, - 726, 727, 728, 730, 731, 732, 770, 771, 772, 773, - 774, 775, 733, 734, 735, 736, 766, 757, 755, 756, - 752, 753, 529, 311, 744, 750, 751, 758, 759, 761, - 760, 762, 763, 234,-32766,-32766,-32766, 307, 754, 765, - 764, 48, 49, 50, 486, 51, 52, 481, 397, 18, - 321, 53, 54, 345, 55,-32766, 982,-32766,-32766,-32766, - -32766,-32766,-32766,-32767,-32767,-32767,-32767,-32767, 349,-32767, - -32767,-32767,-32767, 99, 100, 101, 102, 103, 814, 354, - 815, 1191, 356, 1152, 871, 271, 408, 871, 56, 57, - 409, 814, 410, 815, 58, -188, 59, 240, 241, 60, - 61, 62, 63, 64, 65, 66, 67,-32766, 26, 262, - 68, 412, 487, 411, 672, 967, 1185, 1186, 488, 1150, - 1216, 1154, 1153, 1155, 1183, 40, 23, 489, 1009, 490, - -82, 491, 147, 492, 969, 970, 493, 494, 786, 429, - 430, 42, 43, 413, 418, 415, 871, 44, 495, 391, - 496, 497, 248, 344, 320, 1159, 1154, 1153, 1155, 793, - 896, 498, 499, 500, 148, 1008, 861, 692, 787, 861, - 967, 1254, 501, 502, 150, 1173, 1174, 1175, 1176, 1170, - 1171, 281, 624, 24, 26, -14, 151, 1177, 1172, 969, - 970, 1154, 1153, 1155, 282, -82, 1216, -502, 152, 69, - 1183, 305, 306, 311, 34, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 154, -149, - -149, -149, 639, 640, 146, 376, 1159, 1159, 861, 615, - 616, 32, 243, 35, -149, 1216, -149, 121, -149, 873, - -149, 667, 873, 122, 667, 242, 1067, 1069, 501, 502, - 414, 1173, 1174, 1175, 1176, 1170, 1171, -501, 127, -502, - -502, 496, 497, 1177, 1172, -504, 128, 871, 424, 425, - 847, 896, -107, -107, -502, 71, 442, 443, 306, 311, - -107,-32766, 432, 433, -49, 141, -502, 1152, -508, 155, - 156, 780, 157, -84,-32766,-32766,-32766, 673,-32766, -76, - -32766, 873,-32766, 667, -149,-32766, 1216, 1216, 1179, 282, - -32766,-32766,-32766, -73, 73, -71,-32766,-32766, 311, -501, - -501, 129,-32766, 388, -70, -69,-32766, -504, -504, -68, - -32766, -67, 1152, -66, -501, -65, 871, -64, 275,-32766, - -32766,-32766, -504,-32766, -45,-32766, -501,-32766, -16, 861, - -32766, 145, -107, 264, -504,-32766,-32766,-32766, 682, 72, - 244,-32766,-32766,-32766, 685, 782, 674,-32766, 388, 1152, - 669, 871, -501, 870, 144,-32766,-32766,-32766,-32766, 272, - -32766, 282,-32766, 273,-32766, 73, 73,-32766, 1216, 311, - 311, 276,-32766,-32766,-32766, 885,-32766, 246,-32766,-32766, - 277, 677, 1152, 314,-32766, 388, -4, 871, 263,-32766, - -32766,-32766,-32766,-32766, 107,-32766, 143,-32766, 861, 778, - -32766, 871, 873,-32766, 667,-32766,-32766,-32766, 625, 647, - 871,-32766,-32766,-32766, -501, -501, 787,-32766, 388, 1152, - 1037,-32766, 969, 970, 1266,-32766,-32766,-32766,-32766, -501, - -32766, 531,-32766, 861,-32766, 660, 871,-32766, 630, 535, - 683, -501,-32766,-32766,-32766, 138,-32766, 642,-32766,-32766, - 1023, 311, 1152, 20,-32766, 388, 437, 466, 631,-32766, - -32766,-32766,-32766,-32766, 643,-32766, 286,-32766, -506, 861, - -32766, 913, 407, 667, 613,-32766,-32766,-32766,-32766, 284, - -467,-32766,-32766, 861, 46, 283, 282,-32766, 388, 686, - 897, 414, 861, 402, 898,-32766, 294, 38, 280, -232, - -232, -232, 496, 497, 1007, 414, 873, 26, 667, 1190, - 786, 806, 896, -107, -107, 1192, 496, 497, 861, 1216, - 47, -457, 8, 1183, 22, 847, 896, -107, -107, 347, - -506, -506, 541, 9, -231, -231, -231, 581, 1180, 887, - 414, 39, 873, 848, 667, -4, 289, 290, 689, 690, - 852, 496, 497, 937, 914, 1261, 873, -506, 667, -232, - 847, 896, -107, -107, 921, 873, 911, 667, 922, 850, - 909, -537, 502, 123, 1173, 1174, 1175, 1176, 1170, 1171, - 1012, 1015, 291, 292, 1016, 1013, 1177, 1172, 1014, 1020, - 1263, 873, 30, 667, -231, 304, 798, 348, 71, 1205, - 1223, 306, 311, 1257, 618, -535, 346, 668, -107, 125, - -107, 671, 675, 676, 678, 285, 679, 680, -107, -107, - -107, -107, -107, -107, -107, 684, 670, -257, 809, 808, - 817, 895, 929, 816, 1262, 894, 892, 893, 1138, 880, - 888, 878, 919, 920, 1260, 1217, 1206, 1224, 1230, 1233, - 0, -509, -508, -507, 1, 27, 28, 37, 41, 45, - 70, 74, -308, -255, 75, 76, 77, 78, 79, 140, - 149, 153, 239, 310, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 403, 404, 0, -254, 12, - 13, 14, 15, 17, 375, 457, 458, 465, 468, 469, - 470, 471, 475, 476, 477, 484, 654, 1163, 1106, 1181, - 984, 1142, -259, -99, 11, 16, 25, 279, 374, 574, - 578, 605, 659, 1110, 1158, 1107, 1236, 0, -471, 1123, - 0, 1184 + 322, 263,-32766,-32766,-32766, 104, 105, 106, 346, 263, + 952, 951, 950, 107, 350, 438, 439, 701,-32766,-32766, + -32766, 107, -253,-32766, 355,-32766,-32766,-32766,-32766,-32766, + -32766, 702, 703, 704, 705, 706, 707, 708, 452,-32766, + 770,-32766,-32766,-32766,-32766,-32766, 357, 709, 710, 711, + 712, 713, 714, 715, 716, 717, 718, 719, 739, 762, + 740, 741, 742, 743, 731, 732, 733, 761, 734, 735, + 720, 721, 722, 724, 725, 726, 764, 765, 766, 767, + 768, 769, 727, 728, 729, 730, 760, 751, 749, 750, + 746, 747, 619, 24, 738, 744, 745, 752, 753, 755, + 754, 756, 757, 524,-32766,-32766,-32766, 574, 748, 759, + 758, 48, 49, 50, 483, 51, 52, 147, 397, 580, + 408, 53, 54, 409, 55,-32766, 975,-32766,-32766,-32766, + -32766,-32766,-32766,-32767,-32767,-32767,-32767,-32767, 865,-32767, + -32767,-32767,-32767, 99, 100, 101, 102, 103, 1257, 410, + 1172, 1258, 411, 1145, 865, 271, 634, 635, 56, 57, + 148, 808, 1184, 809, 58, 453, 59, 240, 241, 60, + 61, 62, 63, 64, 65, 66, 67, 787, 26, 262, + 68, 412, 484, 121, 667,-32766, 1178, 1179, 485, 1143, + 781, 1147, 1146, 1148, 1176, 40, 23, 486, 1002, 487, + 150, 488, 234, 489, 962, 963, 490, 491, 780, 423, + 424, 42, 43, 413, 417, 415, 865, 44, 492, 151, + 855, 920, 248, 345, 321, 1152, 1147, 1146, 1148, 122, + 781, 493, 494, 495, 152, -330, 855, -330, 127, -505, + 960, 154, 496, 497, 35, 1166, 1167, 1168, 1169, 1163, + 1164, 280, 146, 377, 26, -14, 128, 1170, 1165, 962, + 963, 1147, 1146, 1148, 281, 141, 781, -501, 155, 69, + 1176, 305, 306, 309, 34, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 156, -149, + -149, -149, 478, 867, 18, 662, 1152, 1152, 855, 440, + 441, -505, -505, 157, -149, 781, -149, 138, -149, 867, + -149, 662, 808, 309, 809, 242, 1060, 1062, 496, 497, + 414, 1166, 1167, 1168, 1169, 1163, 1164, -500, -505, -501, + -501, -107, -107, 1170, 1165, -503, 1228, 865, 611, 612, + 841, -107, -107, -107, -501, 71, 921, -84, 306, 309, + -107,-32766, -76, 1001, -49, 686, -501, 1145, -507, -73, + -71, 774, -70, -69,-32766,-32766,-32766, 668,-32766, -68, + -32766, 867,-32766, 662, -149,-32766, 781, 781, -67, 281, + -32766,-32766,-32766, -66, 73, -65,-32766,-32766, 309, -500, + -500, 129,-32766, 388, -64, -45,-32766, -503, -503, -16, + -32766, 145, 1145, 264, -500, 676, 865, 679, 864,-32766, + -32766,-32766, -503,-32766, 772,-32766, -500,-32766, 144, 855, + -32766, 272, -107, 273, -503,-32766,-32766,-32766, 879, 72, + 244,-32766,-32766,-32766, 275, 776, 669,-32766, 388, 1145, + 664, 865, -500, 274, 276,-32766,-32766,-32766,-32766, 315, + -32766, 281,-32766, 263,-32766, 73, 73,-32766, 107, 309, + 309, 143,-32766,-32766,-32766, 642,-32766, 246,-32766,-32766, + 532, 671, 1145, 772,-32766, 388, -4, 865, 1259,-32766, + -32766,-32766,-32766,-32766, 781,-32766,-32766,-32766, 855, 1030, + -32766, 865, 867, 139, 662,-32766,-32766,-32766, 655, 309, + 865,-32766,-32766,-32766, -500, -500, 526,-32766, 388, 1145, + 101, 102, 103, 620, 637,-32766,-32766,-32766,-32766, -500, + -32766, 960,-32766, 855,-32766, 20, 865,-32766,-32766, 625, + 677, -500,-32766,-32766,-32766, 435,-32766, 463,-32766,-32766, + 962, 963, 1145, 626,-32766, 388, 638, 962, 963,-32766, + -32766,-32766,-32766,-32766, 609,-32766, 289,-32766, 46, 855, + -32766, 906, 407, 662,-32766,-32766,-32766,-32766, 287, 1016, + 1183,-32766,-32766, 855, 286, 293, 781,-32766, 388, 1247, + 890, 414, 855, 402, 891,-32766, 881, 538, 279, -231, + -231, -231, -107, -107, 1000, 414, 867, 26, 662, 1185, + 578, 800, -107, -107, -107, -466, -107, -107, 855, 781, + 47, -456, 7, 1176, 22, 841, -107, -107, -107, 348, + 282, 283, 780, 9, -230, -230, -230, 281, 1173, -536, + 414, 38, 867, 39, 662, -4, 683, 684, 846, 32, + 243, -107, -107, 930, 907, 680, 867, 123, 662, -231, + 841, -107, -107, -107, 914, 867, 904, 662, 915, 844, + 902, 1005, 497, 1008, 1166, 1167, 1168, 1169, 1163, 1164, + 1009, 1006, 284, 285, 1007, 1013, 1170, 1165, 792, 1198, + 1216, 867, 30, 662, -230, 304, 1250, 349, 71, 614, + 842, 306, 309, 347, 663, 666, 670, 672, -107, 125, + -107, 673, 674, 678, 665, 288, 1254, 1256, -107, -107, + -107, -107, -107, -107, -107, 803, 802, 811, 888, 922, + 810, 1255, 887, 886, 1131, 874, 882, 872, 912, 913, + 1253, 1210, 1199, 1217, 1223, 1226, 0, -534, -508, -507, + -506, 1, 27, 28, 37, 41, 45, 70, 74, 75, + 76, 77, -307, -256, 78, 79, 140, 149, 153, 239, + 311, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 403, 404, 0, -254, -253, 12, 13, 14, + 15, 17, 376, 454, 455, 462, 465, 466, 467, 468, + 472, 473, 474, 481, 649, 1156, 1099, 1174, 977, 1135, + -258, -99, 11, 16, 25, 278, 375, 571, 575, 601, + 654, 1103, 1151, 1100, 1229, 0, -470, 1116, 0, 1177, + 0, 309 ); protected $actionCheck = array( - 2, 3, 4, 5, 6, 7, 115, 9, 10, 11, - 12, 13, 157, 1, 31, 73, 161, 9, 10, 11, - 8, 79, 79, 31, 1, 134, 135, 0, 86, 87, - 88, 8, 90, 1, 92, 37, 94, 1, 30, 97, + 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, + 12, 13, 1, 116, 117, 73, 1, 9, 10, 11, + 1, 79, 79, 126, 127, 128, 1, 8, 86, 87, + 88, 8, 90, 8, 92, 37, 94, 8, 30, 97, 32, 33, 34, 101, 102, 103, 104, 9, 10, 11, - 108, 109, 14, 105, 56, 107, 114, 115, 115, 116, - 117, 118, 119, 120, 122, 105, 106, 8, 70, 71, - 72, 73, 74, 75, 76, 115, 1, 79, 115, 116, + 108, 109, 14, 1, 56, 79, 114, 115, 115, 116, + 117, 118, 119, 120, 122, 105, 106, 1, 70, 71, + 72, 73, 74, 75, 76, 115, 8, 79, 115, 116, 117, 118, 119, 120, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 8, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 153, 8, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 1, 158, 79, 69, 1, 147, 148, 149, 156, 151, + 157, 1, 8, 69, 161, 147, 148, 149, 8, 151, 9, 10, 11, 2, 3, 4, 5, 6, 7, 161, - 9, 10, 11, 12, 13, 9, 10, 11, 73, 157, - 9, 10, 11, 161, 79, 80, 49, 50, 51, 50, - 157, 86, 87, 88, 161, 90, 30, 92, 37, 94, - 158, 30, 97, 32, 33, 34, 35, 102, 103, 104, - 118, 119, 120, 108, 109, 131, 132, 56, 79, 114, - 115, 82, 9, 10, 11, 14, 153, 122, 79, 8, - 146, 70, 71, 72, 73, 74, 75, 76, 9, 10, - 79, 156, 158, 30, 160, 32, 33, 86, 87, 88, + 9, 10, 11, 12, 13, 9, 10, 11, 73, 158, + 9, 10, 11, 158, 79, 80, 157, 9, 10, 164, + 161, 86, 87, 88, 161, 90, 30, 92, 37, 94, + 161, 30, 97, 32, 33, 34, 35, 102, 103, 104, + 8, 105, 106, 108, 109, 131, 132, 56, 156, 114, + 115, 115, 9, 10, 11, 14, 8, 122, 31, 8, + 146, 70, 71, 72, 73, 74, 75, 76, 8, 161, + 79, 8, 158, 30, 160, 32, 33, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 161, 161, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 69, 9, 10, 11, 158, 147, 148, - 149, 158, 151, 2, 3, 4, 5, 6, 7, 1, + 129, 130, 8, 96, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 69, 9, 10, 11, 157, 147, 148, + 149, 161, 151, 2, 3, 4, 5, 6, 7, 9, 9, 10, 11, 12, 13, 30, 8, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 8, 56, 9, 10, 11, 52, 53, 54, 1, 56, - 81, 8, 8, 68, 8, 131, 132, 56, 9, 10, + 8, 56, 9, 10, 11, 52, 53, 54, 8, 56, + 118, 119, 120, 68, 8, 131, 132, 56, 9, 10, 11, 68, 161, 30, 8, 32, 33, 34, 35, 36, - 37, 70, 71, 72, 73, 74, 75, 76, 8, 30, + 37, 70, 71, 72, 73, 74, 75, 76, 31, 30, 79, 32, 33, 34, 35, 36, 8, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 84, 164, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 96, 9, 10, 11, 8, 147, 148, - 149, 2, 3, 4, 5, 6, 7, 105, 79, 107, + 129, 130, 74, 75, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 84, 9, 10, 11, 1, 147, 148, + 149, 2, 3, 4, 5, 6, 7, 14, 79, 50, 8, 12, 13, 8, 15, 30, 1, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 8, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 105, 8, - 107, 143, 8, 79, 1, 30, 8, 1, 49, 50, - 8, 105, 8, 107, 55, 161, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 9, 69, 70, - 71, 72, 73, 8, 31, 115, 77, 78, 79, 115, + 35, 36, 37, 38, 39, 40, 41, 42, 1, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 79, 8, + 1, 82, 8, 79, 1, 30, 74, 75, 49, 50, + 14, 105, 143, 107, 55, 158, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 8, 69, 70, + 71, 72, 73, 16, 31, 115, 77, 78, 79, 115, 81, 152, 153, 154, 85, 86, 87, 88, 159, 90, - 31, 92, 14, 94, 134, 135, 97, 98, 152, 105, - 106, 102, 103, 104, 105, 106, 1, 108, 109, 115, - 116, 117, 37, 114, 115, 1, 152, 153, 154, 8, - 126, 122, 123, 124, 14, 156, 83, 158, 81, 83, - 115, 84, 133, 134, 14, 136, 137, 138, 139, 140, - 141, 142, 74, 75, 69, 31, 14, 148, 149, 134, - 135, 152, 153, 154, 155, 96, 81, 69, 14, 160, + 14, 92, 96, 94, 134, 135, 97, 98, 152, 105, + 106, 102, 103, 104, 105, 106, 1, 108, 109, 14, + 83, 31, 37, 114, 115, 1, 152, 153, 154, 16, + 81, 122, 123, 124, 14, 105, 83, 107, 16, 69, + 115, 14, 133, 134, 14, 136, 137, 138, 139, 140, + 141, 142, 100, 101, 69, 31, 16, 148, 149, 134, + 135, 152, 153, 154, 155, 16, 81, 69, 16, 160, 85, 162, 163, 164, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 14, 74, - 75, 76, 74, 75, 100, 101, 1, 1, 83, 110, - 111, 144, 145, 14, 89, 81, 91, 16, 93, 156, - 95, 158, 156, 16, 158, 37, 58, 59, 133, 134, - 105, 136, 137, 138, 139, 140, 141, 69, 16, 131, - 132, 116, 117, 148, 149, 69, 16, 1, 105, 106, - 125, 126, 127, 128, 146, 160, 105, 106, 163, 164, - 126, 73, 127, 128, 31, 16, 158, 79, 160, 16, - 16, 79, 16, 31, 86, 87, 88, 31, 90, 31, - 92, 156, 94, 158, 159, 97, 81, 81, 1, 155, + 22, 23, 24, 25, 26, 27, 28, 29, 16, 74, + 75, 76, 105, 156, 107, 158, 1, 1, 83, 105, + 106, 131, 132, 16, 89, 81, 91, 158, 93, 156, + 95, 158, 105, 164, 107, 37, 58, 59, 133, 134, + 105, 136, 137, 138, 139, 140, 141, 69, 158, 131, + 132, 116, 117, 148, 149, 69, 1, 1, 110, 111, + 125, 126, 127, 128, 146, 160, 156, 31, 163, 164, + 126, 73, 31, 156, 31, 158, 158, 79, 160, 31, + 31, 79, 31, 31, 86, 87, 88, 31, 90, 31, + 92, 156, 94, 158, 159, 97, 81, 81, 31, 155, 102, 103, 104, 31, 160, 31, 108, 109, 164, 131, 132, 31, 114, 115, 31, 31, 73, 131, 132, 31, - 122, 31, 79, 31, 146, 31, 1, 31, 30, 86, - 87, 88, 146, 90, 31, 92, 158, 94, 31, 83, - 97, 31, 126, 31, 158, 102, 103, 104, 31, 151, - 37, 108, 109, 73, 31, 153, 31, 114, 115, 79, - 158, 1, 69, 31, 31, 122, 86, 87, 88, 35, - 90, 155, 92, 35, 94, 160, 160, 97, 81, 164, - 164, 35, 102, 103, 104, 37, 73, 37, 108, 109, - 35, 31, 79, 35, 114, 115, 0, 1, 56, 86, - 87, 88, 122, 90, 68, 92, 69, 94, 83, 79, - 97, 1, 156, 115, 158, 102, 103, 104, 89, 76, - 1, 108, 109, 73, 131, 132, 81, 114, 115, 79, - 81, 84, 134, 135, 82, 122, 86, 87, 88, 146, - 90, 84, 92, 83, 94, 91, 1, 97, 95, 88, - 31, 158, 102, 103, 104, 158, 73, 93, 108, 109, - 121, 164, 79, 96, 114, 115, 96, 96, 99, 86, - 87, 88, 122, 90, 99, 92, 113, 94, 69, 83, - 97, 156, 126, 158, 112, 102, 103, 104, 115, 130, - 146, 108, 109, 83, 69, 129, 155, 114, 115, 159, - 126, 105, 83, 107, 126, 122, 129, 156, 112, 99, + 122, 31, 79, 31, 146, 31, 1, 31, 31, 86, + 87, 88, 146, 90, 79, 92, 158, 94, 31, 83, + 97, 35, 126, 35, 158, 102, 103, 104, 37, 151, + 37, 108, 109, 73, 35, 153, 31, 114, 115, 79, + 158, 1, 69, 30, 35, 122, 86, 87, 88, 35, + 90, 155, 92, 56, 94, 160, 160, 97, 68, 164, + 164, 69, 102, 103, 104, 76, 73, 37, 108, 109, + 88, 31, 79, 79, 114, 115, 0, 1, 82, 86, + 87, 88, 122, 90, 81, 92, 84, 94, 83, 81, + 97, 1, 156, 158, 158, 102, 103, 104, 91, 164, + 1, 108, 109, 73, 131, 132, 84, 114, 115, 79, + 49, 50, 51, 89, 93, 122, 86, 87, 88, 146, + 90, 115, 92, 83, 94, 96, 1, 97, 115, 95, + 31, 158, 102, 103, 104, 96, 73, 96, 108, 109, + 134, 135, 79, 99, 114, 115, 99, 134, 135, 86, + 87, 88, 122, 90, 112, 92, 113, 94, 69, 83, + 97, 156, 126, 158, 115, 102, 103, 104, 130, 121, + 143, 108, 109, 83, 129, 129, 81, 114, 115, 84, + 126, 105, 83, 107, 126, 122, 151, 150, 112, 99, 100, 101, 116, 117, 1, 105, 156, 69, 158, 143, - 152, 125, 126, 127, 128, 143, 116, 117, 83, 81, + 150, 125, 126, 127, 128, 146, 116, 117, 83, 81, 69, 146, 146, 85, 146, 125, 126, 127, 128, 146, - 131, 132, 150, 147, 99, 100, 101, 150, 157, 151, - 105, 156, 156, 159, 158, 159, 131, 132, 156, 156, - 156, 116, 117, 156, 156, 159, 156, 158, 158, 159, + 131, 132, 152, 147, 99, 100, 101, 155, 157, 160, + 105, 156, 156, 156, 158, 159, 156, 156, 156, 144, + 145, 116, 117, 156, 156, 159, 156, 158, 158, 159, 125, 126, 127, 128, 156, 156, 156, 158, 156, 156, - 156, 160, 134, 158, 136, 137, 138, 139, 140, 141, - 156, 156, 131, 132, 156, 156, 148, 149, 156, 156, - 159, 156, 158, 158, 159, 158, 157, 146, 160, 157, - 157, 163, 164, 157, 157, 160, 158, 158, 105, 158, - 107, 158, 158, 158, 158, 112, 158, 158, 115, 116, - 117, 118, 119, 120, 121, 158, 158, 161, 159, 159, + 156, 156, 134, 156, 136, 137, 138, 139, 140, 141, + 156, 156, 131, 132, 156, 156, 148, 149, 157, 157, + 157, 156, 158, 158, 159, 158, 157, 146, 160, 157, + 159, 163, 164, 158, 158, 158, 158, 158, 105, 158, + 107, 158, 158, 158, 158, 112, 159, 159, 115, 116, + 117, 118, 119, 120, 121, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - -1, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 159, 159, 159, 159, 159, 159, -1, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 159, 161, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, -1, 161, 161, + 160, 160, 160, 160, -1, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, -1, 162, 162, - -1, 163 + 161, 161, 161, 161, 161, -1, 162, 162, -1, 163, + -1, 164 ); protected $actionBase = array( - 0, -2, 151, 555, 816, 830, 865, 379, 717, 622, - 862, 676, 780, 780, 839, 780, 493, 745, 301, 301, - -57, 301, 301, 496, 496, 496, 618, 618, 618, 618, + 0, -2, 151, 555, 816, 830, 865, 489, 379, 622, + 858, 676, 780, 780, 839, 780, 493, 745, 301, 301, + -57, 301, 301, 477, 477, 477, 618, 618, 618, 618, -58, -58, 95, 700, 733, 770, 663, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, @@ -496,63 +496,63 @@ class Php7 extends \PhpParser\ParserAbstract 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, - 803, 803, 803, 803, 803, 803, 803, 803, 75, -8, - 347, 629, 986, 992, 988, 993, 984, 983, 987, 989, - 994, 915, 916, 753, 917, 918, 919, 920, 990, 877, - 985, 991, 285, 285, 285, 285, 285, 285, 285, 285, + 803, 803, 803, 803, 803, 803, 803, 803, 52, 530, + 446, 570, 984, 990, 986, 991, 982, 981, 985, 987, + 992, 911, 912, 727, 913, 914, 915, 916, 988, 872, + 983, 989, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 508, 38, 219, 141, 141, 141, 141, + 285, 285, 285, 300, 38, 168, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 156, 156, 156, 203, 525, 525, 8, 598, 161, 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, 349, 333, 435, 435, 435, 435, 435, 436, 436, 436, 436, - 933, 564, 636, 635, 465, -52, 127, 127, 718, 718, - 759, 410, 410, 410, 444, -109, -109, -109, 74, 538, - 396, 348, 414, 414, 414, 414, 414, 802, 998, 139, - 139, 139, 139, 414, 414, 414, 606, 713, 713, 881, - 293, 293, 293, 713, 383, 777, 497, 383, 497, 129, - 793, 32, -40, -145, 793, 829, 845, 23, 12, 788, - 573, 788, 767, 863, 898, 995, 82, 789, 913, 795, - 914, 224, 678, 981, 981, 981, 981, 981, 981, 981, - 981, 981, 981, 981, 269, 982, 63, 269, 269, 269, - 529, 63, 518, 558, 63, 778, 982, 75, 805, 75, - 75, 75, 75, 944, 75, 75, 75, 75, 75, 75, - 949, 727, 723, 692, -17, 75, -8, 143, 143, 419, - 36, 143, 143, 143, 143, 75, 75, 565, 573, 762, - 812, 581, 817, 344, 762, 762, 762, 509, 121, 201, - 122, 352, 750, 750, 768, 769, 924, 924, 750, 765, - 750, 769, 929, 750, 768, 768, 750, 924, 768, 761, - 343, 488, 452, 470, 768, 768, 492, 924, 370, 768, - 768, 750, 750, 750, 797, 768, 494, 750, 356, 346, - 750, 750, 768, 768, 797, 786, 59, 779, 924, 924, - 924, 797, 455, 779, 779, 822, 823, 792, 732, 439, - 378, 561, 332, 768, 732, 732, 750, 481, 792, 732, - 792, 732, 818, 732, 732, 732, 792, 732, 765, 484, - 732, 768, 515, 211, 732, 27, 930, 931, 672, 934, - 927, 935, 955, 936, 937, 879, 794, 798, 942, 928, - 938, 926, 925, 752, 631, 637, 806, 764, 923, 756, - 756, 756, 921, 756, 756, 756, 756, 756, 756, 756, - 756, 631, 811, 813, 776, 781, 945, 652, 660, 796, - 814, 996, 997, 944, 976, 939, 771, 679, 962, 946, - 760, 867, 947, 948, 963, 977, 978, 826, 757, 861, - 899, 869, 950, 883, 756, 930, 937, 928, 938, 926, - 925, 716, 714, 710, 712, 708, 704, 694, 703, 730, - 875, 841, 872, 949, 922, 631, 873, 958, 864, 964, - 965, 878, 790, 772, 876, 900, 951, 952, 953, 884, - 979, 885, 815, 959, 896, 966, 791, 901, 967, 968, - 969, 970, 886, 902, 888, 824, 749, 932, 773, 903, - 528, 766, 775, 956, 560, 943, 889, 904, 905, 971, - 972, 973, 906, 907, 940, 827, 960, 784, 961, 957, - 828, 838, 570, 754, 758, 582, 594, 908, 909, 941, - 737, 763, 840, 842, 980, 910, 614, 843, 683, 911, - 975, 684, 686, 774, 897, 808, 783, 787, 954, 743, - 844, 912, 854, 855, 858, 974, 859, 0, 0, 0, + 933, 564, 636, 635, 465, 470, 801, 801, 753, 753, + 788, 746, 746, 746, 410, 410, 410, 74, 538, 396, + 359, 414, 675, 675, 675, 675, 414, 414, 414, 414, + 796, 996, 414, 414, 414, -103, 606, 713, 713, 881, + 293, 293, 293, 713, 547, 762, 835, 547, 835, 15, + 409, 789, -40, 96, -17, 789, 510, 829, 140, 19, + 810, 444, 810, 742, 859, 886, 993, 232, 784, 909, + 787, 910, 224, 661, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 997, 980, -24, 997, 997, + 997, 568, -24, 358, 422, -24, 754, 980, 52, 805, + 52, 52, 52, 52, 941, 52, 52, 52, 52, 52, + 52, 946, 708, 704, 668, 347, 52, 530, 11, 11, + 537, 66, 11, 11, 11, 11, 52, 52, 444, 737, + 777, 534, 790, 68, 737, 737, 737, 187, 23, 201, + 29, 527, 734, 734, 731, 748, 921, 921, 734, 743, + 734, 748, 926, 734, 731, 731, 921, 731, 812, 208, + 452, 332, 346, 731, 731, 455, 921, 223, 731, 731, + 734, 734, 734, 731, 481, 734, 220, 211, 734, 734, + 731, 731, 785, 786, 122, 921, 921, 921, 786, 340, + 778, 778, 820, 821, 782, 712, 308, 274, 509, 192, + 731, 712, 712, 734, 356, 782, 712, 782, 712, 775, + 712, 712, 712, 782, 712, 743, 378, 712, 731, 484, + 134, 712, 6, 927, 928, 656, 929, 924, 930, 952, + 931, 934, 876, 939, 925, 935, 923, 922, 717, 507, + 553, 806, 799, 920, 730, 730, 730, 918, 730, 730, + 730, 730, 730, 730, 730, 730, 507, 811, 813, 776, + 722, 942, 562, 580, 767, 871, 994, 995, 794, 798, + 941, 974, 936, 815, 589, 960, 943, 826, 867, 944, + 945, 961, 975, 976, 887, 732, 888, 896, 861, 947, + 877, 730, 927, 934, 925, 935, 923, 922, 703, 694, + 687, 692, 678, 672, 669, 671, 710, 917, 809, 862, + 946, 919, 507, 863, 956, 864, 962, 963, 875, 779, + 736, 869, 897, 948, 949, 950, 878, 977, 817, 957, + 932, 964, 781, 898, 965, 966, 967, 968, 899, 879, + 883, 822, 764, 954, 774, 900, 443, 739, 749, 953, + 486, 940, 884, 901, 902, 969, 970, 971, 903, 937, + 827, 958, 761, 959, 955, 828, 838, 526, 726, 728, + 545, 560, 904, 905, 938, 714, 729, 840, 842, 978, + 906, 567, 843, 592, 907, 973, 612, 627, 747, 885, + 808, 783, 769, 951, 716, 844, 908, 845, 847, 854, + 972, 855, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 449, 449, 449, 449, 449, - 449, 301, 301, 301, 301, 449, 449, 449, 449, 449, - 449, 449, 0, 0, 301, 0, 0, 449, 449, 449, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 449, + 449, 449, 449, 449, 449, 301, 301, 301, 301, 449, + 449, 449, 449, 449, 449, 449, 0, 0, 301, 0, + 0, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, @@ -565,41 +565,40 @@ class Php7 extends \PhpParser\ParserAbstract 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 285, 285, 285, + 449, 449, 449, 449, 449, 449, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 285, 285, 285, 414, 414, - 285, 0, 285, 414, 414, 414, 414, 414, 414, 414, - 414, 414, 414, 285, 285, 285, 285, 285, 285, 285, - 293, 293, 293, 293, 761, 414, 414, 414, 414, -37, - 293, 293, 414, 414, -37, 414, 414, 414, 761, 414, - 414, 414, 0, 0, 63, 497, 0, 0, 0, 0, - 0, 497, 497, 269, 269, 269, 269, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63, 497, - 0, 63, 0, 765, 414, 269, 761, 308, 414, 0, - 0, 0, 0, 63, 765, 63, 497, 143, 75, 308, - 0, 534, 534, 534, 534, 0, 573, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 0, 761, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 765, - 768, 0, 924, 0, 0, 0, 0, 750, 0, 0, - 0, 0, 0, 0, 750, 929, 768, 768, 0, 0, - 0, 0, 0, 0, 765, 0, 0, 0, 0, 0, - 0, 0, 0, 756, 790, 0, 790, 0, 756, 756, - 756 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 414, 414, 285, 0, 285, 414, 414, 414, + 414, 414, 414, 414, 414, 414, 414, 285, 285, 285, + 285, 285, 285, 285, 293, 293, 293, 293, 812, 414, + 414, 414, 414, -37, 293, 293, 414, 414, -37, 414, + 414, 414, 414, 414, 414, 0, 0, -24, 835, 0, + 743, 743, 743, 743, 0, 0, 0, 0, 835, 835, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -24, 835, 0, -24, 0, 743, 743, 414, + 812, 812, 25, 414, 0, 0, 0, 0, -24, 743, + -24, 835, 11, 52, 25, 0, 492, 492, 492, 492, + 0, 444, 812, 812, 812, 812, 812, 812, 812, 812, + 812, 812, 812, 743, 812, 0, 743, 743, 743, 0, + 0, 0, 0, 0, 743, 731, 0, 921, 0, 0, + 0, 0, 734, 0, 0, 0, 0, 0, 0, 734, + 926, 731, 731, 0, 0, 0, 0, 0, 0, 743, + 0, 0, 0, 0, 0, 0, 0, 730, 779, 0, + 779, 0, 730, 730, 730 ); protected $actionDefault = array( 3,32767, 99,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767, 97, - 32767,32767,32767,32767,32767,32767, 555, 555, 555, 555, - 236, 99,32767,32767,32767,32767, 431, 350, 350, 350, - 32767,32767, 499, 499, 499, 499, 499, 499,32767,32767, - 32767,32767,32767,32767, 431,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 554, 554, 554, 554, + 235, 99,32767,32767,32767,32767, 430, 349, 349, 349, + 32767,32767, 498, 498, 498, 498, 498, 498,32767,32767, + 32767,32767,32767,32767, 430,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, @@ -610,129 +609,125 @@ class Php7 extends \PhpParser\ParserAbstract 35, 5, 6, 8, 9, 48, 15,32767,32767,32767, 32767,32767, 99,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 548,32767,32767,32767,32767,32767,32767,32767,32767, + 32767, 547,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 435, 414, 415, 417, 418, 349, 500, 554, - 293, 551, 348, 142, 305, 295, 224, 296, 240, 241, - 267, 345, 146, 379, 432, 381, 430, 434, 380, 355, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 353, 354, 433, 436, 437, 440, 441, - 411, 410, 409, 377,32767,32767, 378, 352, 382,32767, - 32767,32767,32767,32767,32767,32767,32767, 99,32767, 384, - 383, 400, 401, 398, 399, 402, 403, 404, 405, 406, - 32767,32767,32767,32767,32767, 328, 391, 392, 284, 284, - 330,32767,32767,32767, 108,32767,32767,32767, 493, 408, + 32767,32767, 434, 413, 414, 416, 417, 348, 499, 553, + 292, 550, 347, 142, 304, 294, 223, 295, 239, 240, + 266, 344, 146, 378, 431, 380, 429, 433, 379, 354, + 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 352, 353, 432, 435, 436, 439, 440, + 410, 409, 408, 376,32767,32767, 377, 351, 381,32767, + 32767,32767,32767,32767,32767,32767,32767, 99,32767, 383, + 382, 399, 400, 397, 398, 401, 402, 403, 404, 405, + 32767,32767,32767,32767,32767, 327, 390, 391, 283, 283, + 329,32767,32767,32767,32767,32767,32767, 492, 407,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 99,32767, 97, 495, 374, 376, 463, - 386, 387, 385, 356,32767, 470,32767, 99, 472,32767, - 32767,32767,32767,32767,32767, 494,32767, 501, 501,32767, - 456, 97,32767,32767,32767,32767, 262,32767,32767,32767, - 32767, 562, 456, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107,32767, 107,32767,32767,32767, 97, - 185,32767, 250, 252, 99, 516, 190,32767, 475,32767, + 32767,32767, 99,32767, 97,32767, 494, 373, 375, 462, + 385, 386, 384, 355,32767, 469,32767, 99, 471,32767, + 32767,32767, 108,32767,32767,32767, 493,32767, 500, 500, + 32767, 455, 97,32767,32767,32767,32767, 261,32767,32767, + 32767,32767, 561, 455, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 107, 107,32767, 107,32767,32767,32767, + 97, 185,32767, 249, 251, 99, 515, 190,32767, 474, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 468, 190, 190,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 456, 396, - 135,32767, 135, 501, 388, 389, 390, 458, 501, 501, - 501,32767,32767,32767, 190,32767, 473, 473, 97, 97, - 97, 97, 468,32767, 190, 190,32767,32767, 190, 108, - 96, 96, 96, 96, 190, 190, 96, 100, 98, 190, - 190,32767,32767,32767, 205, 190, 96,32767, 98, 98, - 32767,32767, 190, 190, 205, 207, 98, 209,32767, 520, - 521, 205, 98, 209, 209, 229, 229, 447, 286, 98, - 96, 98, 98, 190, 286, 286,32767, 98, 447, 286, - 447, 286, 192, 286, 286, 286, 447, 286,32767, 98, - 286, 190, 96, 96, 286,32767,32767,32767, 458,32767, + 32767,32767, 467, 190, 190,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 455, 395, + 135,32767, 135, 500, 387, 388, 389, 457, 500, 500, + 500,32767,32767,32767, 190,32767, 472, 472, 97, 97, + 97, 97, 467,32767, 190, 190,32767, 190, 108, 96, + 96, 96, 96, 190, 190, 96, 100, 98, 190, 190, + 32767,32767,32767, 190, 96,32767, 98, 98,32767,32767, + 190, 190, 206, 204, 98,32767, 519, 520, 204, 98, + 208, 208, 228, 228, 446, 285, 98, 96, 98, 98, + 190, 285, 285,32767, 98, 446, 285, 446, 285, 192, + 285, 285, 285, 446, 285,32767, 98, 285, 190, 96, + 96, 285,32767,32767,32767, 457,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 488,32767, 505, 518, 394, - 395, 397, 503, 419, 420, 421, 422, 423, 424, 425, - 427, 550,32767, 462,32767,32767,32767,32767, 304, 560, - 32767, 560,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 561,32767, 501, - 32767,32767,32767,32767, 393, 7, 74, 41, 42, 50, - 56, 479, 480, 481, 482, 476, 477, 483, 478,32767, - 484, 526,32767,32767, 502, 553,32767,32767,32767,32767, - 32767,32767, 135,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 488,32767, 133,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 501,32767,32767, - 32767, 281, 283,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 501, - 32767,32767,32767, 269, 271,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 266,32767, - 32767, 344,32767,32767,32767,32767, 324,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 148, 148, 3, - 3, 307, 148, 148, 148, 307, 307, 148, 307, 307, - 148, 148, 148, 148, 148, 148, 180, 244, 247, 229, - 229, 148, 316, 148 + 487,32767, 504, 517, 393, 394, 396, 502, 418, 419, + 420, 421, 422, 423, 424, 426, 549,32767, 461,32767, + 32767,32767,32767, 303, 559,32767, 559,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 560,32767, 500,32767,32767,32767, + 32767, 392, 7, 74, 41, 42, 50, 56, 478, 479, + 480, 481, 475, 476, 482, 477,32767, 483, 525,32767, + 32767, 501, 552,32767,32767,32767,32767,32767,32767, 135, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 487,32767, 133,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 500,32767,32767,32767, 280, 282,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 500,32767,32767,32767, 268, 270, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 265,32767,32767, 343,32767,32767,32767, + 32767, 323,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767, 148, 148, 3, 3, 306, 148, 148, 148, + 306, 148, 306, 306, 148, 148, 148, 148, 148, 148, + 180, 243, 246, 228, 228, 148, 315, 148 ); protected $goto = array( - 190, 190, 655, 781, 663, 399, 629, 964, 971, 972, - 393, 297, 298, 317, 549, 303, 398, 318, 400, 607, - 361, 365, 534, 572, 576, 161, 161, 161, 161, 187, + 190, 190, 650, 1020, 979, 399, 624, 798, 1019, 658, + 393, 297, 298, 318, 546, 303, 398, 319, 400, 603, + 362, 366, 531, 569, 573, 161, 161, 161, 161, 187, 187, 171, 173, 209, 191, 204, 187, 187, 187, 187, 187, 188, 188, 188, 188, 188, 188, 182, 183, 184, - 185, 186, 206, 204, 207, 509, 510, 389, 511, 513, - 514, 515, 516, 517, 518, 519, 520, 1053, 162, 163, + 185, 186, 206, 204, 207, 504, 505, 389, 506, 508, + 509, 510, 511, 512, 513, 514, 515, 1046, 162, 163, 164, 189, 165, 166, 167, 160, 168, 169, 170, 172, 203, 205, 208, 230, 233, 236, 238, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 266, 267, - 300, 301, 302, 394, 395, 396, 554, 210, 211, 212, + 300, 301, 302, 394, 395, 396, 551, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 174, 225, 175, 192, 193, 194, 231, 182, - 183, 184, 185, 186, 206, 1053, 195, 176, 177, 178, + 183, 184, 185, 186, 206, 1046, 195, 176, 177, 178, 196, 192, 179, 232, 197, 159, 198, 226, 180, 199, - 227, 228, 181, 229, 200, 201, 202, 807, 611, 611, - 804, 274, 274, 274, 274, 976, 973, 974, 592, 626, - 1147, 594, 594, 571, 533, 526, 1182, 1182, 1182, 1182, - 1182, 1182, 1182, 1182, 1182, 1182, 1250, 1250, 986, 328, - 812, 1027, 860, 855, 856, 869, 1026, 813, 857, 810, - 858, 859, 811, 803, 1251, 1251, 805, 1250, 863, 912, - 936, 910, 910, 908, 910, 687, 363, 526, 1003, 1004, - 533, 1253, 525, 945, 940, 1251, 542, 543, 820, 1148, - 838, 370, 552, 832, 308, 288, 819, 573, 864, 795, - 865, 1200, 1200, 785, 587, 588, 1200, 1200, 1200, 1200, - 1200, 1200, 1200, 1200, 1200, 1200, 1151, 1151, 1151, 968, - 1149, 1208, 1209, 968, 968, 472, 968, 968, 968, 779, - 968, 968, 968, 1232, 1232, 1232, 1232, 1151, 1151, 1151, - 1151, 1151, 785, 21, 785, 546, 1198, 1198, 1151, 1151, - 1151, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, - 1198, 523, 523, 523, 325, 876, 512, 512, 392, 877, - 582, 512, 512, 512, 512, 512, 512, 512, 512, 512, - 512, 1240, 427, 906, 906, 906, 906, 387, 387, 387, - 387, 602, 604, 427, 900, 907, 540, 904, 379, 662, - 688, 606, 608, 933, 5, 627, 6, 539, 645, 649, - 947, 653, 661, 943, 586, 377, 378, 800, 1019, 570, - 635, 666, 636, 359, 381, 382, 383, 453, 646, 652, - 652, 384, 658, 1017, 454, 323, 580, 595, 598, 599, - 600, 601, 619, 620, 621, 665, 527, 537, 1267, 450, - 1225, 1226, 527, 545, 537, 800, 628, 362, 1101, 528, - 434, 521, 521, 521, 521, 1227, 1228, 1132, 890, 405, - 575, 1133, 1136, 891, 1137, 444, 553, 445, 419, 419, - 419, 830, 329, 330, 1258, 1259, 1222, 1222, 1222, 622, - 623, 431, 637, 638, 1211, 439, 439, 550, 585, 881, - 1041, 797, 319, 833, 821, 991, 439, 590, 995, 825, - 828, 369, 822, 952, 1234, 1234, 1234, 1234, 915, 648, - 824, 955, 632, 931, 473, 691, 474, 992, 818, 1144, - 451, 996, 480, 0, 834, 1036, 1218, 917, 0, 0, - 1143, 0, 905, 0, 0, 0, 0, 0, 528, 0, - 0, 419, 419, 419, 419, 419, 419, 419, 419, 419, - 419, 419, 800, 419, 1034, 837, 0, 0, 0, 994, - 0, 0, 1220, 1220, 994, 0, 0, 0, 0, 0, + 227, 228, 181, 229, 200, 201, 202, 312, 312, 312, + 312, 801, 577, 591, 594, 595, 596, 597, 615, 616, + 617, 660, 799, 329, 530, 521, 590, 590, 568, 794, + 794, 1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175, + 1175, 858, 779, 859, 806, 775, 854, 849, 850, 863, + 905, 807, 851, 804, 852, 853, 805, 295, 295, 295, + 295, 832, 857, 607, 607, 364, 521, 773, 530, 969, + 966, 967, 996, 997, 539, 540, 957, 964, 965, 371, + 549, 588, 621, 779, 570, 779, 1244, 1244, 1193, 1193, + 543, 584, 585, 1193, 1193, 1193, 1193, 1193, 1193, 1193, + 1193, 1193, 1193, 326, 1244, 1144, 1144, 1144, 961, 1140, + 1233, 469, 961, 961, 926, 961, 961, 961, 961, 961, + 961, 1225, 1225, 1225, 1225, 1144, 470, 360, 471, 21, + 1144, 1144, 1144, 1144, 477, 794, 1144, 1144, 1144, 332, + 437, 437, 567, 1012, 618, 661, 632, 633, 542, 332, + 332, 437, 623, 647, 647, 870, 653, 1010, 1094, 871, + 447, 1218, 1219, 814, 332, 332, 1141, 332, 826, 1260, + 5, 813, 6, 518, 518, 518, 789, 320, 1191, 1191, + 523, 791, 332, 1191, 1191, 1191, 1191, 1191, 1191, 1191, + 1191, 1191, 1191, 426, 405, 1142, 1201, 1202, 899, 899, + 899, 899, 370, 536, 426, 893, 900, 897, 380, 657, + 583, 507, 507, 308, 291, 1204, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 1243, 1243, 516, 516, + 516, 516, 1220, 1221, 819, 875, 1034, 572, 547, 582, + 643, 522, 534, 587, 1243, 816, 948, 522, 945, 534, + 685, 985, 363, 330, 331, 818, 828, 627, 924, 1246, + 392, 1137, 579, 812, 418, 418, 418, 448, 523, 550, + 442, 443, 989, 1029, 824, 1136, 910, 1251, 1252, 451, + 600, 537, 1215, 1215, 1215, 682, 602, 604, 0, 622, + 0, 0, 640, 644, 940, 648, 656, 936, 0, 0, + 797, 0, 822, 1227, 1227, 1227, 1227, 929, 903, 903, + 901, 903, 681, 0, 270, 519, 519, 0, 0, 520, + 938, 933, 0, 827, 815, 984, 0, 0, 988, 0, + 1211, 0, 0, 0, 1139, 0, 0, 908, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, 418, 0, + 418, 0, 378, 379, 0, 0, 0, 630, 0, 631, + 898, 382, 383, 384, 0, 641, 987, 0, 385, 1213, + 1213, 987, 324, 1125, 884, 0, 0, 1126, 1129, 885, + 1130, 0, 1027, 831, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 270, 524, 524, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 950, - 950 + 0, 0, 0, 0, 0, 0, 943, 943 ); protected $gotoCheck = array( - 41, 41, 71, 6, 8, 64, 64, 105, 105, 105, + 41, 41, 71, 128, 111, 64, 64, 25, 128, 8, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 57, 57, 57, 57, 57, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, @@ -747,93 +742,90 @@ class Php7 extends \PhpParser\ParserAbstract 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 14, 107, 107, - 25, 22, 22, 22, 22, 107, 107, 107, 54, 54, - 19, 99, 99, 114, 74, 74, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 164, 164, 111, 88, - 14, 128, 14, 14, 14, 14, 128, 14, 14, 14, - 14, 14, 14, 24, 165, 165, 26, 164, 14, 48, - 24, 24, 24, 24, 24, 24, 74, 74, 14, 14, - 74, 164, 24, 24, 24, 165, 74, 74, 34, 19, - 44, 74, 74, 34, 151, 151, 34, 74, 63, 19, - 63, 152, 152, 11, 74, 74, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 71, 71, 71, 71, - 19, 19, 19, 71, 71, 74, 71, 71, 71, 5, - 71, 71, 71, 8, 8, 8, 8, 71, 71, 71, - 71, 71, 11, 74, 11, 154, 153, 153, 71, 71, - 71, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 18, 18, 18, 161, 71, 155, 155, 12, 71, - 12, 155, 155, 155, 155, 155, 155, 155, 155, 155, - 155, 163, 18, 18, 18, 18, 18, 23, 23, 23, - 23, 81, 81, 18, 18, 18, 47, 84, 84, 84, - 47, 47, 47, 94, 45, 47, 45, 8, 47, 47, - 47, 47, 47, 47, 8, 78, 78, 21, 7, 7, - 78, 7, 78, 60, 78, 78, 78, 80, 78, 7, - 7, 78, 7, 7, 80, 78, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 8, 8, 13, 158, - 158, 158, 8, 95, 8, 21, 62, 8, 135, 13, - 8, 98, 98, 98, 98, 160, 160, 76, 76, 103, - 98, 76, 76, 76, 76, 8, 8, 8, 22, 22, - 22, 8, 88, 88, 8, 8, 114, 114, 114, 82, - 82, 79, 82, 82, 13, 133, 133, 2, 2, 16, - 16, 17, 28, 15, 15, 15, 133, 16, 15, 38, - 8, 27, 36, 16, 114, 114, 114, 114, 15, 13, - 16, 101, 16, 16, 139, 90, 139, 113, 16, 144, - 141, 116, 139, -1, 40, 131, 114, 87, -1, -1, - 16, -1, 15, -1, -1, -1, -1, -1, 13, -1, - -1, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 21, 22, 15, 15, -1, -1, -1, 114, - -1, -1, 114, 114, 114, -1, -1, -1, -1, -1, + 41, 41, 41, 41, 41, 41, 41, 22, 22, 22, + 22, 14, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 26, 88, 74, 74, 99, 99, 114, 21, + 21, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 63, 11, 63, 14, 6, 14, 14, 14, 14, + 48, 14, 14, 14, 14, 14, 14, 23, 23, 23, + 23, 44, 14, 107, 107, 74, 74, 5, 74, 107, + 107, 107, 14, 14, 74, 74, 105, 105, 105, 74, + 74, 54, 54, 11, 74, 11, 165, 165, 152, 152, + 154, 74, 74, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 161, 165, 71, 71, 71, 71, 19, + 163, 74, 71, 71, 94, 71, 71, 71, 71, 71, + 71, 8, 8, 8, 8, 71, 139, 60, 139, 74, + 71, 71, 71, 71, 139, 21, 71, 71, 71, 13, + 133, 133, 7, 7, 82, 7, 82, 82, 95, 13, + 13, 133, 62, 7, 7, 71, 7, 7, 135, 71, + 158, 158, 158, 34, 13, 13, 19, 13, 34, 13, + 45, 34, 45, 18, 18, 18, 19, 28, 153, 153, + 13, 17, 13, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 18, 103, 19, 19, 19, 18, 18, + 18, 18, 27, 8, 18, 18, 18, 84, 84, 84, + 8, 155, 155, 151, 151, 13, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 164, 164, 98, 98, + 98, 98, 160, 160, 38, 16, 16, 98, 2, 2, + 13, 8, 8, 16, 164, 36, 101, 8, 16, 8, + 90, 113, 8, 88, 88, 16, 40, 16, 16, 164, + 12, 144, 12, 16, 22, 22, 22, 141, 13, 8, + 8, 8, 116, 131, 8, 16, 87, 8, 8, 80, + 81, 47, 114, 114, 114, 47, 47, 47, -1, 47, + -1, -1, 47, 47, 47, 47, 47, 47, -1, -1, + 24, -1, 8, 114, 114, 114, 114, 24, 24, 24, + 24, 24, 24, -1, 23, 23, 23, -1, -1, 24, + 24, 24, -1, 15, 15, 15, -1, -1, 15, -1, + 114, -1, -1, -1, 13, -1, -1, 15, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, -1, + 22, -1, 78, 78, -1, -1, -1, 78, -1, 78, + 15, 78, 78, 78, -1, 78, 114, -1, 78, 114, + 114, 114, 78, 76, 76, -1, -1, 76, 76, 76, + 76, -1, 15, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 23, 23, 23, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 98, - 98 + -1, -1, -1, -1, -1, -1, 98, 98 ); protected $gotoBase = array( - 0, 0, -232, 0, 0, 249, -6, 351, -16, 0, - 0, -37, -11, 79, -167, 22, 1, 148, 40, -188, - 0, 83, 158, 324, 199, 156, 202, 132, 162, 0, - 0, 0, 0, 0, -118, 0, 131, 0, 142, 0, - 66, -1, 0, 0, 211, -347, 0, -332, 192, 0, - 0, 0, 0, 0, 130, 0, 0, -23, 0, 0, - 323, 0, 161, 225, -229, 0, 0, 0, 0, 0, - 0, -5, 0, 0, -198, 0, 30, 42, -109, 157, - -77, -122, -246, 0, 53, 0, 0, 67, -267, 0, - 89, 0, 0, 0, 312, 352, 0, 0, 375, -63, - 0, 116, 0, 140, 0, -264, 0, -110, 0, 0, - 0, 186, 0, 118, 165, 0, 62, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -74, 0, - 0, 64, 0, 405, 0, 135, 0, 0, 0, -4, - 0, 63, 0, 0, 65, 0, 0, 0, 0, 0, - 0, -71, 7, 52, 258, 72, 0, 0, 99, 0, - 58, 276, 0, 292, -101, -83, 0, 0 + 0, 0, -276, 0, 0, 197, 186, 285, -11, 0, + 0, -87, 90, 9, -164, 53, -51, 39, 62, -100, + 0, -133, 154, 204, 446, 3, 168, 32, 48, 0, + 0, 0, 0, 0, -34, 0, 73, 0, 77, 0, + -2, -1, 0, 0, 192, -365, 0, -232, 183, 0, + 0, 0, 0, 0, 193, 0, 0, -23, 0, 0, + 237, 0, 67, 178, -229, 0, 0, 0, 0, 0, + 0, -6, 0, 0, -199, 0, 145, -173, 41, 0, + -19, -21, -376, 0, 70, 0, 0, 16, -280, 0, + 23, 0, 0, 0, 233, 257, 0, 0, 352, -58, + 0, 50, 0, 75, 0, -45, 0, -55, 0, 0, + 0, 2, 0, 51, 171, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -262, 0, + 0, 12, 0, 260, 0, 45, 0, 0, 0, -189, + 0, 10, 0, 0, 7, 0, 0, 0, 0, 0, + 0, 58, 4, 94, 213, 127, 0, 0, 27, 0, + 34, 225, 0, 231, 86, -54, 0, 0 ); protected $gotoDefault = array( - -32768, 485, 695, 4, 696, 769, 777, 569, 503, 664, - 324, 596, 390, 331, 862, 1040, 551, 796, 1160, 1168, - 428, 799, 312, 326, 844, 845, 846, 366, 351, 357, - 364, 617, 597, 467, 831, 422, 823, 459, 826, 421, - 835, 158, 386, 483, 839, 3, 841, 530, 872, 352, - 849, 353, 641, 851, 536, 853, 854, 360, 367, 368, - 1045, 544, 593, 866, 237, 538, 867, 350, 868, 875, - 355, 358, 650, 438, 478, 380, 1021, 579, 614, 416, - 447, 591, 603, 589, 902, 460, 436, 916, 327, 924, - 693, 1052, 609, 462, 932, 610, 939, 942, 504, 505, - 452, 954, 268, 463, 981, 633, 634, 966, 612, 979, - 446, 985, 423, 993, 1204, 426, 997, 260, 1000, 269, - 385, 401, 1005, 1006, 7, 1011, 656, 657, 10, 265, - 482, 1035, 651, 420, 1051, 406, 1120, 1122, 532, 464, - 1140, 1139, 644, 479, 1145, 1207, 417, 506, 448, 299, - 507, 287, 315, 296, 522, 278, 316, 508, 449, 1213, - 1221, 313, 29, 1241, 1252, 322, 548, 584 + -32768, 482, 689, 4, 690, 763, 771, 566, 498, 659, + 325, 592, 390, 1209, 856, 1033, 548, 790, 1153, 1161, + 427, 793, 313, 327, 838, 839, 840, 367, 352, 358, + 365, 613, 593, 464, 825, 421, 817, 456, 820, 420, + 829, 158, 387, 480, 833, 3, 835, 525, 866, 353, + 843, 354, 636, 845, 533, 847, 848, 361, 368, 369, + 1038, 541, 589, 860, 237, 535, 861, 351, 862, 869, + 356, 359, 645, 436, 475, 381, 1014, 576, 610, 432, + 450, 599, 598, 586, 895, 457, 434, 909, 328, 917, + 687, 1045, 605, 459, 925, 606, 932, 935, 499, 500, + 449, 947, 268, 460, 974, 628, 629, 959, 608, 972, + 444, 978, 422, 986, 1197, 425, 990, 260, 993, 269, + 386, 401, 998, 999, 8, 1004, 651, 652, 10, 265, + 479, 1028, 646, 419, 1044, 406, 1113, 1115, 527, 461, + 1133, 1132, 639, 476, 1138, 1200, 416, 501, 445, 299, + 502, 290, 316, 296, 517, 277, 317, 503, 446, 1206, + 1214, 314, 29, 1234, 1245, 323, 545, 581 ); protected $ruleToNonTerminal = array( @@ -857,22 +849,22 @@ class Php7 extends \PhpParser\ParserAbstract 48, 48, 48, 48, 48, 48, 48, 48, 24, 24, 67, 67, 70, 70, 69, 68, 68, 61, 73, 73, 74, 74, 75, 75, 76, 76, 25, 25, 26, 26, - 26, 26, 79, 79, 79, 80, 80, 83, 83, 81, - 81, 84, 85, 85, 55, 55, 63, 63, 66, 66, - 66, 65, 86, 86, 87, 56, 56, 56, 56, 88, - 88, 89, 89, 90, 90, 91, 92, 92, 93, 93, - 94, 94, 53, 53, 49, 49, 96, 51, 51, 97, - 50, 50, 52, 52, 62, 62, 62, 62, 77, 77, - 100, 100, 102, 102, 102, 102, 101, 101, 101, 104, - 104, 104, 105, 105, 107, 107, 107, 106, 106, 108, - 108, 109, 109, 109, 103, 103, 78, 78, 78, 19, - 19, 110, 110, 111, 111, 111, 111, 58, 112, 112, - 113, 59, 115, 115, 116, 116, 117, 117, 82, 118, - 118, 118, 118, 118, 123, 123, 124, 124, 125, 125, - 125, 125, 125, 126, 127, 127, 122, 122, 119, 119, - 121, 121, 129, 129, 128, 128, 128, 128, 128, 128, - 120, 130, 130, 132, 131, 131, 60, 95, 133, 133, - 54, 54, 41, 41, 41, 41, 41, 41, 41, 41, + 26, 79, 79, 79, 80, 80, 83, 83, 81, 81, + 84, 85, 85, 55, 55, 63, 63, 66, 66, 66, + 65, 86, 86, 87, 56, 56, 56, 56, 88, 88, + 89, 89, 90, 90, 91, 92, 92, 93, 93, 94, + 94, 53, 53, 49, 49, 96, 51, 51, 97, 50, + 50, 52, 52, 62, 62, 62, 62, 77, 77, 100, + 100, 102, 102, 102, 102, 101, 101, 101, 104, 104, + 104, 105, 105, 107, 107, 107, 106, 106, 108, 108, + 109, 109, 109, 103, 103, 78, 78, 78, 19, 19, + 110, 110, 111, 111, 111, 111, 58, 112, 112, 113, + 59, 115, 115, 116, 116, 117, 117, 82, 118, 118, + 118, 118, 118, 123, 123, 124, 124, 125, 125, 125, + 125, 125, 126, 127, 127, 122, 122, 119, 119, 121, + 121, 129, 129, 128, 128, 128, 128, 128, 128, 120, + 130, 130, 132, 131, 131, 60, 95, 133, 133, 54, + 54, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, @@ -881,20 +873,20 @@ class Php7 extends \PhpParser\ParserAbstract 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 140, 134, 134, 139, 139, 142, - 143, 143, 144, 145, 145, 145, 18, 18, 71, 71, - 71, 71, 135, 135, 135, 135, 147, 147, 136, 136, - 138, 138, 138, 141, 141, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 153, 153, 99, 155, 155, 155, - 155, 137, 137, 137, 137, 137, 137, 137, 137, 57, - 57, 150, 150, 150, 150, 156, 156, 146, 146, 146, - 157, 157, 157, 157, 157, 157, 72, 72, 64, 64, - 64, 64, 114, 114, 114, 114, 160, 159, 149, 149, - 149, 149, 149, 149, 149, 148, 148, 148, 158, 158, - 158, 158, 98, 154, 162, 162, 161, 161, 163, 163, - 163, 163, 163, 163, 163, 163, 151, 151, 151, 151, - 165, 166, 164, 164, 164, 164, 164, 164, 164, 164, - 167, 167, 167, 167 + 41, 41, 41, 140, 134, 134, 139, 139, 142, 143, + 143, 144, 145, 145, 145, 18, 18, 71, 71, 71, + 71, 135, 135, 135, 135, 147, 147, 136, 136, 138, + 138, 138, 141, 141, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 153, 153, 99, 155, 155, 155, 155, + 137, 137, 137, 137, 137, 137, 137, 137, 57, 57, + 150, 150, 150, 150, 156, 156, 146, 146, 146, 157, + 157, 157, 157, 157, 157, 72, 72, 64, 64, 64, + 64, 114, 114, 114, 114, 160, 159, 149, 149, 149, + 149, 149, 149, 149, 148, 148, 148, 158, 158, 158, + 158, 98, 154, 162, 162, 161, 161, 163, 163, 163, + 163, 163, 163, 163, 163, 151, 151, 151, 151, 165, + 166, 164, 164, 164, 164, 164, 164, 164, 164, 167, + 167, 167, 167 ); protected $ruleToLength = array( @@ -917,45 +909,45 @@ class Php7 extends \PhpParser\ParserAbstract 5, 3, 3, 3, 3, 3, 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, 2, 1, 1, 1, 0, 2, 1, 3, 8, 0, 4, 2, 1, 3, - 0, 1, 0, 1, 3, 1, 8, 9, 7, 8, - 7, 6, 1, 2, 2, 0, 2, 0, 2, 0, - 2, 2, 1, 3, 1, 4, 1, 4, 1, 1, - 4, 2, 1, 3, 3, 3, 4, 4, 5, 0, - 2, 4, 3, 1, 1, 7, 0, 2, 1, 3, - 3, 4, 1, 4, 0, 2, 5, 0, 2, 6, - 0, 2, 0, 3, 1, 2, 1, 1, 2, 0, - 1, 3, 0, 1, 1, 1, 6, 8, 6, 1, - 2, 1, 1, 1, 1, 1, 1, 3, 3, 3, - 3, 1, 2, 1, 0, 1, 0, 2, 2, 2, - 4, 1, 3, 1, 2, 2, 3, 2, 3, 1, - 1, 2, 3, 1, 1, 3, 2, 0, 1, 5, - 5, 10, 3, 1, 1, 3, 0, 2, 4, 5, - 4, 4, 4, 3, 1, 1, 1, 1, 1, 1, - 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, - 2, 1, 3, 1, 1, 3, 2, 2, 3, 1, - 0, 1, 1, 3, 3, 3, 4, 1, 1, 2, + 0, 1, 0, 1, 3, 1, 8, 9, 8, 7, + 6, 1, 2, 2, 0, 2, 0, 2, 0, 2, + 2, 1, 3, 1, 4, 1, 4, 1, 1, 4, + 2, 1, 3, 3, 3, 4, 4, 5, 0, 2, + 4, 3, 1, 1, 7, 0, 2, 1, 3, 3, + 4, 1, 4, 0, 2, 5, 0, 2, 6, 0, + 2, 0, 3, 1, 2, 1, 1, 2, 0, 1, + 3, 0, 1, 1, 1, 6, 8, 6, 1, 2, + 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, + 1, 2, 1, 0, 1, 0, 2, 2, 2, 4, + 1, 3, 1, 2, 2, 3, 2, 3, 1, 1, + 2, 3, 1, 1, 3, 2, 0, 1, 5, 5, + 10, 3, 1, 1, 3, 0, 2, 4, 5, 4, + 4, 4, 3, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, + 1, 3, 1, 1, 3, 2, 2, 3, 1, 0, + 1, 1, 3, 3, 3, 4, 1, 1, 2, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, - 4, 3, 4, 4, 2, 2, 4, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, - 2, 1, 2, 4, 2, 2, 8, 9, 8, 9, - 9, 10, 9, 10, 8, 3, 2, 0, 4, 2, - 1, 3, 2, 2, 2, 4, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 1, 1, 0, 3, - 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 3, 3, 4, 1, 1, - 3, 1, 1, 1, 1, 1, 3, 2, 3, 0, - 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, - 1, 4, 4, 1, 4, 4, 0, 1, 1, 1, - 3, 3, 1, 4, 2, 2, 1, 3, 1, 4, - 4, 3, 3, 3, 3, 1, 3, 1, 1, 3, - 1, 1, 4, 1, 1, 1, 3, 1, 1, 2, - 1, 3, 4, 3, 2, 0, 2, 2, 1, 2, - 1, 1, 1, 4, 3, 3, 3, 3, 6, 3, - 1, 1, 2, 1 + 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, + 3, 4, 4, 2, 2, 4, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 1, 3, 2, + 1, 2, 4, 2, 2, 8, 9, 8, 9, 9, + 10, 9, 10, 8, 3, 2, 0, 4, 2, 1, + 3, 2, 2, 2, 4, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 1, 1, 1, 0, 3, 0, + 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 3, 3, 4, 1, 1, 3, + 1, 1, 1, 1, 1, 3, 2, 3, 0, 1, + 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, + 4, 4, 1, 4, 4, 0, 1, 1, 1, 3, + 3, 1, 4, 2, 2, 1, 3, 1, 4, 4, + 3, 3, 3, 3, 1, 3, 1, 1, 3, 1, + 1, 4, 1, 1, 1, 3, 1, 1, 2, 1, + 3, 4, 3, 2, 0, 2, 2, 1, 2, 1, + 1, 1, 4, 3, 3, 3, 3, 6, 3, 1, + 1, 2, 1 ); protected function initReduceCallbacks() { @@ -1580,478 +1572,477 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, 198 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - $this->checkClass($this->semValue, $stackPos-(7-2)); - }, - 199 => function ($stackPos) { $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); $this->checkClass($this->semValue, $stackPos-(8-3)); }, - 200 => function ($stackPos) { + 199 => function ($stackPos) { $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); $this->checkInterface($this->semValue, $stackPos-(7-3)); }, - 201 => function ($stackPos) { + 200 => function ($stackPos) { $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 202 => function ($stackPos) { + 201 => function ($stackPos) { $this->semValue = 0; }, - 203 => function ($stackPos) { + 202 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; }, - 204 => function ($stackPos) { + 203 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_FINAL; }, - 205 => function ($stackPos) { + 204 => function ($stackPos) { $this->semValue = null; }, + 205 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, 206 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = array(); }, 207 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 208 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = array(); }, 209 => function ($stackPos) { - $this->semValue = array(); - }, - 210 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 211 => function ($stackPos) { + 210 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, + 211 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, 212 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 213 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 214 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 215 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 216 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 217 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 218 => function ($stackPos) { $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, - 219 => function ($stackPos) { + 218 => function ($stackPos) { $this->semValue = null; }, - 220 => function ($stackPos) { + 219 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 221 => function ($stackPos) { + 220 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 222 => function ($stackPos) { + 221 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 223 => function ($stackPos) { + 222 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 224 => function ($stackPos) { + 223 => function ($stackPos) { $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 225 => function ($stackPos) { + 224 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 226 => function ($stackPos) { + 225 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-3)]; }, - 227 => function ($stackPos) { + 226 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 228 => function ($stackPos) { + 227 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(5-3)]; }, - 229 => function ($stackPos) { + 228 => function ($stackPos) { $this->semValue = array(); }, - 230 => function ($stackPos) { + 229 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 231 => function ($stackPos) { + 230 => function ($stackPos) { $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 232 => function ($stackPos) { + 231 => function ($stackPos) { $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, + 232 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos]; + }, 233 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos]; }, 234 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 235 => function ($stackPos) { $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 236 => function ($stackPos) { + 235 => function ($stackPos) { $this->semValue = []; }, - 237 => function ($stackPos) { + 236 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 238 => function ($stackPos) { + 237 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 239 => function ($stackPos) { + 238 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 240 => function ($stackPos) { + 239 => function ($stackPos) { $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 241 => function ($stackPos) { + 240 => function ($stackPos) { $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 242 => function ($stackPos) { + 241 => function ($stackPos) { $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, - 243 => function ($stackPos) { + 242 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 244 => function ($stackPos) { + 243 => function ($stackPos) { $this->semValue = array(); }, + 244 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, 245 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 246 => function ($stackPos) { $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], is_array($this->semStack[$stackPos-(5-5)]) ? $this->semStack[$stackPos-(5-5)] : array($this->semStack[$stackPos-(5-5)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 247 => function ($stackPos) { + 246 => function ($stackPos) { $this->semValue = array(); }, - 248 => function ($stackPos) { + 247 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 249 => function ($stackPos) { + 248 => function ($stackPos) { $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 250 => function ($stackPos) { + 249 => function ($stackPos) { $this->semValue = null; }, - 251 => function ($stackPos) { + 250 => function ($stackPos) { $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 252 => function ($stackPos) { + 251 => function ($stackPos) { $this->semValue = null; }, - 253 => function ($stackPos) { + 252 => function ($stackPos) { $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 254 => function ($stackPos) { + 253 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, - 255 => function ($stackPos) { + 254 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(2-2)], true); }, + 255 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + }, 256 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, 257 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 258 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 259 => function ($stackPos) { + 258 => function ($stackPos) { $this->semValue = array(); }, - 260 => function ($stackPos) { + 259 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 261 => function ($stackPos) { + 260 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 262 => function ($stackPos) { + 261 => function ($stackPos) { $this->semValue = 0; }, - 263 => function ($stackPos) { + 262 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; }, - 264 => function ($stackPos) { + 263 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; }, - 265 => function ($stackPos) { + 264 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; }, - 266 => function ($stackPos) { + 265 => function ($stackPos) { $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); $this->checkParam($this->semValue); }, - 267 => function ($stackPos) { + 266 => function ($stackPos) { $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes, $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); $this->checkParam($this->semValue); }, - 268 => function ($stackPos) { + 267 => function ($stackPos) { $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); }, - 269 => function ($stackPos) { + 268 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, + 269 => function ($stackPos) { + $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, 270 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 271 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 272 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 273 => function ($stackPos) { $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 274 => function ($stackPos) { + 273 => function ($stackPos) { $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); }, - 275 => function ($stackPos) { + 274 => function ($stackPos) { $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 276 => function ($stackPos) { + 275 => function ($stackPos) { $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 277 => function ($stackPos) { + 276 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, + 277 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, 278 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 279 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, - 280 => function ($stackPos) { + 279 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, + 280 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 281 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 282 => function ($stackPos) { $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 283 => function ($stackPos) { + 282 => function ($stackPos) { $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 284 => function ($stackPos) { + 283 => function ($stackPos) { $this->semValue = null; }, - 285 => function ($stackPos) { + 284 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 286 => function ($stackPos) { + 285 => function ($stackPos) { $this->semValue = null; }, - 287 => function ($stackPos) { + 286 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 288 => function ($stackPos) { + 287 => function ($stackPos) { $this->semValue = null; }, - 289 => function ($stackPos) { + 288 => function ($stackPos) { $this->semValue = array(); }, - 290 => function ($stackPos) { + 289 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 291 => function ($stackPos) { + 290 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, + 291 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, 292 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 293 => function ($stackPos) { $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 294 => function ($stackPos) { + 293 => function ($stackPos) { $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 295 => function ($stackPos) { + 294 => function ($stackPos) { $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 296 => function ($stackPos) { + 295 => function ($stackPos) { $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->semStack[$stackPos-(3-1)]); }, - 297 => function ($stackPos) { + 296 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, + 297 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, 298 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 299 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 300 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 301 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 302 => function ($stackPos) { + 301 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 303 => function ($stackPos) { + 302 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 304 => function ($stackPos) { + 303 => function ($stackPos) { $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 305 => function ($stackPos) { + 304 => function ($stackPos) { $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 306 => function ($stackPos) { + 305 => function ($stackPos) { if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } }, - 307 => function ($stackPos) { + 306 => function ($stackPos) { $this->semValue = array(); }, - 308 => function ($stackPos) { + 307 => function ($stackPos) { $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 309 => function ($stackPos) { + 308 => function ($stackPos) { $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); $this->checkProperty($this->semValue, $stackPos-(5-2)); }, - 310 => function ($stackPos) { + 309 => function ($stackPos) { $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-1)]); $this->checkClassConst($this->semValue, $stackPos-(5-2)); }, - 311 => function ($stackPos) { + 310 => function ($stackPos) { $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); $this->checkClassMethod($this->semValue, $stackPos-(10-2)); }, - 312 => function ($stackPos) { + 311 => function ($stackPos) { $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 313 => function ($stackPos) { + 312 => function ($stackPos) { $this->semValue = null; /* will be skipped */ }, - 314 => function ($stackPos) { + 313 => function ($stackPos) { $this->semValue = array(); }, - 315 => function ($stackPos) { + 314 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 316 => function ($stackPos) { + 315 => function ($stackPos) { $this->semValue = array(); }, - 317 => function ($stackPos) { + 316 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 318 => function ($stackPos) { + 317 => function ($stackPos) { $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 319 => function ($stackPos) { + 318 => function ($stackPos) { $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 320 => function ($stackPos) { + 319 => function ($stackPos) { $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, + 320 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, 321 => function ($stackPos) { $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 322 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 323 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, - 324 => function ($stackPos) { + 323 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 325 => function ($stackPos) { + 324 => function ($stackPos) { $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); }, - 326 => function ($stackPos) { + 325 => function ($stackPos) { $this->semValue = null; }, + 326 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 327 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 328 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = 0; }, 329 => function ($stackPos) { $this->semValue = 0; }, 330 => function ($stackPos) { - $this->semValue = 0; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 331 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 332 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 333 => function ($stackPos) { $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; }, - 334 => function ($stackPos) { + 333 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; }, - 335 => function ($stackPos) { + 334 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; }, - 336 => function ($stackPos) { + 335 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; }, - 337 => function ($stackPos) { + 336 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_STATIC; }, - 338 => function ($stackPos) { + 337 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; }, - 339 => function ($stackPos) { + 338 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_FINAL; }, - 340 => function ($stackPos) { + 339 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 341 => function ($stackPos) { + 340 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 342 => function ($stackPos) { + 341 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 343 => function ($stackPos) { + 342 => function ($stackPos) { $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 344 => function ($stackPos) { + 343 => function ($stackPos) { $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 345 => function ($stackPos) { + 344 => function ($stackPos) { $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, + 345 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, 346 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 347 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 348 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 349 => function ($stackPos) { + 348 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 350 => function ($stackPos) { + 349 => function ($stackPos) { $this->semValue = array(); }, + 350 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 351 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 352 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 353 => function ($stackPos) { $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); @@ -2060,428 +2051,428 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 355 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 356 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 357 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 358 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 359 => function ($stackPos) { $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 360 => function ($stackPos) { + 359 => function ($stackPos) { $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 361 => function ($stackPos) { + 360 => function ($stackPos) { $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 362 => function ($stackPos) { + 361 => function ($stackPos) { $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 363 => function ($stackPos) { + 362 => function ($stackPos) { $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 364 => function ($stackPos) { + 363 => function ($stackPos) { $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 365 => function ($stackPos) { + 364 => function ($stackPos) { $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 366 => function ($stackPos) { + 365 => function ($stackPos) { $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 367 => function ($stackPos) { + 366 => function ($stackPos) { $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 368 => function ($stackPos) { + 367 => function ($stackPos) { $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 369 => function ($stackPos) { + 368 => function ($stackPos) { $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 370 => function ($stackPos) { + 369 => function ($stackPos) { $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 371 => function ($stackPos) { + 370 => function ($stackPos) { $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 372 => function ($stackPos) { + 371 => function ($stackPos) { $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 373 => function ($stackPos) { + 372 => function ($stackPos) { $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 374 => function ($stackPos) { + 373 => function ($stackPos) { $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 375 => function ($stackPos) { + 374 => function ($stackPos) { $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 376 => function ($stackPos) { + 375 => function ($stackPos) { $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 377 => function ($stackPos) { + 376 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 378 => function ($stackPos) { + 377 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 379 => function ($stackPos) { + 378 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 380 => function ($stackPos) { + 379 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 381 => function ($stackPos) { + 380 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 382 => function ($stackPos) { + 381 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 383 => function ($stackPos) { + 382 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 384 => function ($stackPos) { + 383 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 385 => function ($stackPos) { + 384 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 386 => function ($stackPos) { + 385 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 387 => function ($stackPos) { + 386 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 388 => function ($stackPos) { + 387 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 389 => function ($stackPos) { + 388 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 390 => function ($stackPos) { + 389 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 391 => function ($stackPos) { + 390 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 392 => function ($stackPos) { + 391 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 393 => function ($stackPos) { + 392 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 394 => function ($stackPos) { + 393 => function ($stackPos) { $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 395 => function ($stackPos) { + 394 => function ($stackPos) { $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 396 => function ($stackPos) { + 395 => function ($stackPos) { $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 397 => function ($stackPos) { + 396 => function ($stackPos) { $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 398 => function ($stackPos) { + 397 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 399 => function ($stackPos) { + 398 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 400 => function ($stackPos) { + 399 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 401 => function ($stackPos) { + 400 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 402 => function ($stackPos) { + 401 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 403 => function ($stackPos) { + 402 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 404 => function ($stackPos) { + 403 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 405 => function ($stackPos) { + 404 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 406 => function ($stackPos) { + 405 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 407 => function ($stackPos) { + 406 => function ($stackPos) { $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 408 => function ($stackPos) { + 407 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 409 => function ($stackPos) { + 408 => function ($stackPos) { $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 410 => function ($stackPos) { + 409 => function ($stackPos) { $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 411 => function ($stackPos) { + 410 => function ($stackPos) { $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 412 => function ($stackPos) { + 411 => function ($stackPos) { $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 413 => function ($stackPos) { + 412 => function ($stackPos) { $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 414 => function ($stackPos) { + 413 => function ($stackPos) { $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 415 => function ($stackPos) { + 414 => function ($stackPos) { $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 416 => function ($stackPos) { + 415 => function ($stackPos) { $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 417 => function ($stackPos) { + 416 => function ($stackPos) { $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 418 => function ($stackPos) { + 417 => function ($stackPos) { $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 419 => function ($stackPos) { + 418 => function ($stackPos) { $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 420 => function ($stackPos) { + 419 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); }, - 421 => function ($stackPos) { + 420 => function ($stackPos) { $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 422 => function ($stackPos) { + 421 => function ($stackPos) { $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 423 => function ($stackPos) { + 422 => function ($stackPos) { $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 424 => function ($stackPos) { + 423 => function ($stackPos) { $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 425 => function ($stackPos) { + 424 => function ($stackPos) { $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 426 => function ($stackPos) { + 425 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); }, - 427 => function ($stackPos) { + 426 => function ($stackPos) { $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 428 => function ($stackPos) { + 427 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 429 => function ($stackPos) { + 428 => function ($stackPos) { $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 430 => function ($stackPos) { + 429 => function ($stackPos) { $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 431 => function ($stackPos) { + 430 => function ($stackPos) { $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 432 => function ($stackPos) { + 431 => function ($stackPos) { $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 433 => function ($stackPos) { + 432 => function ($stackPos) { $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 434 => function ($stackPos) { + 433 => function ($stackPos) { $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 435 => function ($stackPos) { + 434 => function ($stackPos) { $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 436 => function ($stackPos) { + 435 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 437 => function ($stackPos) { + 436 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 438 => function ($stackPos) { + 437 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 439 => function ($stackPos) { + 438 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 440 => function ($stackPos) { + 439 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 441 => function ($stackPos) { + 440 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 442 => function ($stackPos) { + 441 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 443 => function ($stackPos) { + 442 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 444 => function ($stackPos) { + 443 => function ($stackPos) { $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes), $this->semStack[$stackPos-(8-3)]); $this->checkClass($this->semValue[0], -1); }, - 445 => function ($stackPos) { + 444 => function ($stackPos) { $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 446 => function ($stackPos) { + 445 => function ($stackPos) { list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 447 => function ($stackPos) { + 446 => function ($stackPos) { $this->semValue = array(); }, - 448 => function ($stackPos) { + 447 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-3)]; }, - 449 => function ($stackPos) { + 448 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 450 => function ($stackPos) { + 449 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 451 => function ($stackPos) { + 450 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 452 => function ($stackPos) { + 451 => function ($stackPos) { $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, + 452 => function ($stackPos) { + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, 453 => function ($stackPos) { $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 454 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 455 => function ($stackPos) { $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 456 => function ($stackPos) { + 455 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 457 => function ($stackPos) { + 456 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, + 457 => function ($stackPos) { + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, 458 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 459 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 460 => function ($stackPos) { $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 461 => function ($stackPos) { + 460 => function ($stackPos) { $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, + 461 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 462 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 463 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 464 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 465 => function ($stackPos) { + 464 => function ($stackPos) { $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; }, + 465 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 466 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 467 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 468 => function ($stackPos) { $this->semValue = null; }, - 469 => function ($stackPos) { + 468 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 470 => function ($stackPos) { + 469 => function ($stackPos) { $this->semValue = array(); }, - 471 => function ($stackPos) { + 470 => function ($stackPos) { $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); }, - 472 => function ($stackPos) { + 471 => function ($stackPos) { foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 473 => function ($stackPos) { + 472 => function ($stackPos) { $this->semValue = array(); }, - 474 => function ($stackPos) { + 473 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 475 => function ($stackPos) { + 474 => function ($stackPos) { $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 476 => function ($stackPos) { + 475 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 477 => function ($stackPos) { + 476 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 478 => function ($stackPos) { + 477 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 479 => function ($stackPos) { + 478 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 480 => function ($stackPos) { + 479 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 481 => function ($stackPos) { + 480 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 482 => function ($stackPos) { + 481 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 483 => function ($stackPos) { + 482 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 484 => function ($stackPos) { + 483 => function ($stackPos) { $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 485 => function ($stackPos) { + 484 => function ($stackPos) { $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2; }, - 486 => function ($stackPos) { + 485 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); }, - 487 => function ($stackPos) { + 486 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); }, - 488 => function ($stackPos) { + 487 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 489 => function ($stackPos) { + 488 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes; $attrs['kind'] = ($this->semStack[$stackPos-(1-1)][0] === "'" || ($this->semStack[$stackPos-(1-1)][1] === "'" && ($this->semStack[$stackPos-(1-1)][0] === 'b' || $this->semStack[$stackPos-(1-1)][0] === 'B')) ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED); $this->semValue = new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos-(1-1)]), $attrs); }, - 490 => function ($stackPos) { + 489 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); }, - 491 => function ($stackPos) { + 490 => function ($stackPos) { $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 492 => function ($stackPos) { + 491 => function ($stackPos) { $this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos-(1-1)]), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, + 492 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 493 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, @@ -2489,28 +2480,28 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 495 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); }, 496 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); - }, - 497 => function ($stackPos) { $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true); }, - 498 => function ($stackPos) { + 497 => function ($stackPos) { $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); }, - 499 => function ($stackPos) { + 498 => function ($stackPos) { $this->semValue = null; }, + 499 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 500 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 501 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 502 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 503 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -2525,35 +2516,35 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 507 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 508 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 509 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 510 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 511 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 512 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 513 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 514 => function ($stackPos) { + 513 => function ($stackPos) { $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 515 => function ($stackPos) { + 514 => function ($stackPos) { $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 516 => function ($stackPos) { + 515 => function ($stackPos) { $this->semValue = null; }, + 516 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 517 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, @@ -2561,168 +2552,165 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 519 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 520 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 521 => function ($stackPos) { + 520 => function ($stackPos) { $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, + 521 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 522 => function ($stackPos) { - $this->semValue = substr($this->semStack[$stackPos-(1-1)], 1); + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 523 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 524 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, + 524 => function ($stackPos) { + $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; + }, 525 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; + $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; }, 526 => function ($stackPos) { - $var = $this->semStack[$stackPos-(1-1)]; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; - }, - 527 => function ($stackPos) { $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, + 527 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 528 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 529 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 530 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 531 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 532 => function ($stackPos) { + 531 => function ($stackPos) { $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, + 532 => function ($stackPos) { + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, 533 => function ($stackPos) { $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 534 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 535 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 536 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 537 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 538 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 539 => function ($stackPos) { + 537 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 538 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 540 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 539 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 541 => function ($stackPos) { + 540 => function ($stackPos) { $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; }, - 542 => function ($stackPos) { + 541 => function ($stackPos) { $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 543 => function ($stackPos) { + 542 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue); }, - 544 => function ($stackPos) { + 543 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos]; }, - 545 => function ($stackPos) { + 544 => function ($stackPos) { /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ }, - 546 => function ($stackPos) { + 545 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 547 => function ($stackPos) { + 546 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 548 => function ($stackPos) { + 547 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 549 => function ($stackPos) { + 548 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 550 => function ($stackPos) { + 549 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 551 => function ($stackPos) { + 550 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 552 => function ($stackPos) { + 551 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 553 => function ($stackPos) { + 552 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 554 => function ($stackPos) { + 553 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 555 => function ($stackPos) { + 554 => function ($stackPos) { $this->semValue = null; }, + 555 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, 556 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 557 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 558 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 559 => function ($stackPos) { + 558 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); }, - 560 => function ($stackPos) { + 559 => function ($stackPos) { $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 561 => function ($stackPos) { + 560 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 562 => function ($stackPos) { + 561 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 563 => function ($stackPos) { + 562 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 564 => function ($stackPos) { + 563 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 565 => function ($stackPos) { + 564 => function ($stackPos) { $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, + 565 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, 566 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 567 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 568 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 569 => function ($stackPos) { + 568 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 570 => function ($stackPos) { + 569 => function ($stackPos) { $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 571 => function ($stackPos) { + 570 => function ($stackPos) { $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 572 => function ($stackPos) { + 571 => function ($stackPos) { $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 573 => function ($stackPos) { + 572 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, ]; diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php index 11c8568db..3ff474264 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +++ b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php @@ -219,10 +219,7 @@ abstract class ParserAbstract implements Parser )); } - // This is necessary to assign some meaningful attributes to /* empty */ productions. They'll get - // the attributes of the next token, even though they don't contain it themselves. - $this->startAttributeStack[$stackPos+1] = $startAttributes; - $this->endAttributeStack[$stackPos+1] = $endAttributes; + // Allow productions to access the start attributes of the lookahead token. $this->lookaheadStartAttributes = $startAttributes; //$this->traceRead($symbol); @@ -294,7 +291,8 @@ abstract class ParserAbstract implements Parser /* Goto - shift nonterminal */ $lastEndAttributes = $this->endAttributeStack[$stackPos]; - $stackPos -= $this->ruleToLength[$rule]; + $ruleLength = $this->ruleToLength[$rule]; + $stackPos -= $ruleLength; $nonTerminal = $this->ruleToNonTerminal[$rule]; $idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos]; if ($idx >= 0 && $idx < $this->gotoTableSize && $this->gotoCheck[$idx] === $nonTerminal) { @@ -307,6 +305,10 @@ abstract class ParserAbstract implements Parser $stateStack[$stackPos] = $state; $this->semStack[$stackPos] = $this->semValue; $this->endAttributeStack[$stackPos] = $lastEndAttributes; + if ($ruleLength === 0) { + // Empty productions use the start attributes of the lookahead token. + $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes; + } } else { /* error */ switch ($this->errorState) { @@ -340,6 +342,7 @@ abstract class ParserAbstract implements Parser // We treat the error symbol as being empty, so we reset the end attributes // to the end attributes of the last non-error symbol + $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes; $this->endAttributeStack[$stackPos] = $this->endAttributeStack[$stackPos - 1]; $this->endAttributes = $this->endAttributeStack[$stackPos - 1]; break; diff --git a/vendor/phpspec/prophecy/.github/workflows/build.yml b/vendor/phpspec/prophecy/.github/workflows/build.yml new file mode 100644 index 000000000..d65b4d96d --- /dev/null +++ b/vendor/phpspec/prophecy/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + release: + types: [created] + +jobs: + tests: + runs-on: ubuntu-latest + name: Build and test + strategy: + fail-fast: false + matrix: + php: [7.2, 7.3, 7.4, 8.0] + composer-flags: [ "" ] + include: + - php: 7.2 + composer-flags: "--prefer-lowest" + + steps: + - uses: actions/checkout@v2 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + coverage: none + + - name: Install dependencies + run: COMPOSER_ROOT_VERSION=dev-master composer update ${{ matrix.composer-flags }} + id: end-of-setup + + - name: Run tests (phpspec) + run: ./vendor/bin/phpspec run --format=dot + if: always() && steps.end-of-setup.outcome == 'success' + + - name: Run tests (phpunit) + run: ./vendor/bin/phpunit + if: always() && steps.end-of-setup.outcome == 'success' diff --git a/vendor/phpspec/prophecy/CHANGES.md b/vendor/phpspec/prophecy/CHANGES.md index c33837b92..47397b27b 100644 --- a/vendor/phpspec/prophecy/CHANGES.md +++ b/vendor/phpspec/prophecy/CHANGES.md @@ -1,3 +1,8 @@ +1.12.2 / 2020/12/19 +=================== + +* [fixed] MethodNotFoundException sometimes thrown with wrong class attached [@ciaranmcnulty] + 1.12.1 / 2020/10/29 =================== diff --git a/vendor/phpspec/prophecy/README.md b/vendor/phpspec/prophecy/README.md index 603359430..f0d2ff089 100644 --- a/vendor/phpspec/prophecy/README.md +++ b/vendor/phpspec/prophecy/README.md @@ -97,7 +97,7 @@ $prophecy->willImplement('SessionHandlerInterface'); ``` There are 2 interesting calls - `willExtend` and `willImplement`. The first one tells -object prophecy that our object should extend specific class, the second one says that +object prophecy that our object should extend a specific class. The second one says that it should implement some interface. Obviously, objects in PHP can implement multiple interfaces, but extend only one parent class. diff --git a/vendor/phpspec/prophecy/composer.json b/vendor/phpspec/prophecy/composer.json index 3bde8812f..de6b7c2b9 100644 --- a/vendor/phpspec/prophecy/composer.json +++ b/vendor/phpspec/prophecy/composer.json @@ -27,7 +27,7 @@ "require-dev": { "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0 || ^9.0 <9.3" + "phpunit/phpunit": "^8.0 || ^9.0" }, "autoload": { diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php index b41ebaa28..0330ebc85 100644 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php +++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php @@ -92,7 +92,7 @@ PHP $__call->setCode(<<getProphecy(), func_get_arg(0) + get_class(\$this), func_get_arg(0) ); PHP ); diff --git a/vendor/swiftmailer/swiftmailer/.gitattributes b/vendor/swiftmailer/swiftmailer/.gitattributes index 09c3fba94..dc96281b6 100644 --- a/vendor/swiftmailer/swiftmailer/.gitattributes +++ b/vendor/swiftmailer/swiftmailer/.gitattributes @@ -5,5 +5,7 @@ *.priv -crlf *.txt -crlf -# ignore /notes in the git-generated distributed .zip archive +# ignore directories in the git-generated distributed .zip archive /doc/notes export-ignore +/tests export-ignore +/phpunit.xml.dist export-ignore diff --git a/vendor/swiftmailer/swiftmailer/.gitignore b/vendor/swiftmailer/swiftmailer/.gitignore index 20d389a1c..a911ddf65 100644 --- a/vendor/swiftmailer/swiftmailer/.gitignore +++ b/vendor/swiftmailer/swiftmailer/.gitignore @@ -1,5 +1,6 @@ /.php_cs.cache /.phpunit +/.phpunit.result.cache /build/* /composer.lock /phpunit.xml diff --git a/vendor/swiftmailer/swiftmailer/.php_cs.dist b/vendor/swiftmailer/swiftmailer/.php_cs.dist index 2c04e04be..563b48b90 100644 --- a/vendor/swiftmailer/swiftmailer/.php_cs.dist +++ b/vendor/swiftmailer/swiftmailer/.php_cs.dist @@ -4,12 +4,17 @@ return PhpCsFixer\Config::create() ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, + '@PHPUnit75Migration:risky' => true, + 'php_unit_dedicate_assert' => ['target' => '5.6'], 'array_syntax' => ['syntax' => 'short'], + 'php_unit_fqcn_annotation' => true, 'no_unreachable_default_argument_value' => false, 'braces' => ['allow_single_line_closure' => true], 'heredoc_to_nowdoc' => false, - 'phpdoc_annotation_without_dot' => false, - 'ternary_to_null_coalescing' => true, + 'ordered_imports' => true, + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'], + 'fopen_flags' => false, ]) ->setRiskyAllowed(true) ->setFinder(PhpCsFixer\Finder::create()->in(__DIR__)) diff --git a/vendor/swiftmailer/swiftmailer/.travis.yml b/vendor/swiftmailer/swiftmailer/.travis.yml index 610585a54..446878246 100644 --- a/vendor/swiftmailer/swiftmailer/.travis.yml +++ b/vendor/swiftmailer/swiftmailer/.travis.yml @@ -1,7 +1,5 @@ language: php -sudo: false - before_script: - cp tests/acceptance.conf.php.default tests/acceptance.conf.php - cp tests/smoke.conf.php.default tests/smoke.conf.php @@ -11,7 +9,11 @@ before_script: - gem install mailcatcher - mailcatcher --smtp-port 4456 -script: SYMFONY_PHPUNIT_VERSION=6.1 ./vendor/bin/simple-phpunit +script: ./vendor/bin/simple-phpunit + +env: + global: + - SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 matrix: include: @@ -19,6 +21,8 @@ matrix: - php: 7.1 - php: 7.2 - php: 7.3 + - php: 7.4 + - php: 8.0 fast_finish: true cache: diff --git a/vendor/swiftmailer/swiftmailer/CHANGES b/vendor/swiftmailer/swiftmailer/CHANGES index ad0c8159b..6de2ff08c 100644 --- a/vendor/swiftmailer/swiftmailer/CHANGES +++ b/vendor/swiftmailer/swiftmailer/CHANGES @@ -1,7 +1,14 @@ Changelog ========= -6.2.2 (2019-11-12) +6.2.4 (2020-12-08) +------------------ + + * Prevent flushing of the bubble queue when event handler raises another event + * Add support for PHP 8 + * Code cleanups + +6.2.3 (2019-11-12) ------------------ * no changes @@ -9,7 +16,7 @@ Changelog 6.2.2 (2019-11-12) ------------------ - * fixed cmopat with PHP 7.4 + * fixed compat with PHP 7.4 * fixed error message when connecting to a stream raises an error before connect() 6.2.1 (2019-04-21) diff --git a/vendor/swiftmailer/swiftmailer/LICENSE b/vendor/swiftmailer/swiftmailer/LICENSE index bb9c80f0c..ccfbbd88d 100644 --- a/vendor/swiftmailer/swiftmailer/LICENSE +++ b/vendor/swiftmailer/swiftmailer/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2018 Fabien Potencier +Copyright (c) 2013-2020 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/swiftmailer/swiftmailer/composer.json b/vendor/swiftmailer/swiftmailer/composer.json index a996e217a..d66dc4ce2 100644 --- a/vendor/swiftmailer/swiftmailer/composer.json +++ b/vendor/swiftmailer/swiftmailer/composer.json @@ -16,18 +16,17 @@ ], "require": { "php": ">=7.0.0", - "egulias/email-validator": "~2.0", + "egulias/email-validator": "^2.0", "symfony/polyfill-iconv": "^1.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-intl-idn": "^1.10" }, "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8" + "mockery/mockery": "^1.0", + "symfony/phpunit-bridge": "^4.4|^5.0" }, "suggest": { - "ext-intl": "Needed to support internationalized email addresses", - "true/punycode": "Needed to support internationalized email addresses, if ext-intl is not installed" + "ext-intl": "Needed to support internationalized email addresses" }, "autoload": { "files": ["lib/swift_required.php"] diff --git a/vendor/swiftmailer/swiftmailer/doc/introduction.rst b/vendor/swiftmailer/swiftmailer/doc/introduction.rst index 774e9f466..8c61cfb2e 100644 --- a/vendor/swiftmailer/swiftmailer/doc/introduction.rst +++ b/vendor/swiftmailer/swiftmailer/doc/introduction.rst @@ -1,7 +1,7 @@ Introduction ============ -Swift Mailer is a for sending e-mails from PHP applications. +Swift Mailer is a component based library for sending e-mails from PHP applications. System Requirements ------------------- diff --git a/vendor/swiftmailer/swiftmailer/doc/messages.rst b/vendor/swiftmailer/swiftmailer/doc/messages.rst index a3431a47c..53c5b36f5 100644 --- a/vendor/swiftmailer/swiftmailer/doc/messages.rst +++ b/vendor/swiftmailer/swiftmailer/doc/messages.rst @@ -100,7 +100,7 @@ with a strict format, you only need to pass a DateTimeInterface instance to +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ | ``Date`` | Specifies the date at which the message was sent | ``getDate()`` / ``setDate()`` | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ -| ``Content-Type`` | Specifies the format of the message (usually text/plain or text/html) | ``getContentType()`` / ``setContentType()`` | +| ``Content-Type`` | Specifies the format of the message (usually ``text/plain`` or ``text/html``) | ``getContentType()`` / ``setContentType()`` | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ | ``Content-Transfer-Encoding`` | Specifies the encoding scheme in the message | ``getEncoder()`` / ``setEncoder()`` | +-------------------------------+------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+ @@ -820,7 +820,7 @@ Requesting a Read Receipt It is possible to request a read-receipt to be sent to an address when the email is opened. To request a read receipt set the address with -``setReadReceiptTo()``: +``setReadReceiptTo()``:: $message->setReadReceiptTo('your@address.tld'); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php index daf75fbd4..1de679623 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php @@ -15,7 +15,7 @@ */ abstract class Swift { - const VERSION = '6.2.3'; + const VERSION = '6.2.4'; public static $initialized = false; public static $inits = []; @@ -56,7 +56,7 @@ abstract class Swift if (self::$inits && !self::$initialized) { self::$initialized = true; foreach (self::$inits as $init) { - call_user_func($init); + \call_user_func($init); } } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/AddressEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/AddressEncoder.php index 7ec3e90b4..a1704ffb4 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/AddressEncoder.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/AddressEncoder.php @@ -18,8 +18,8 @@ interface Swift_AddressEncoder /** * Encodes an email address. * - * @throws Swift_AddressEncoderException If the email cannot be represented in - * the encoding implemented by this class. + * @throws Swift_AddressEncoderException if the email cannot be represented in + * the encoding implemented by this class */ public function encodeString(string $address): string; } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php index 642aa6f23..7a1420f79 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Attachment.php @@ -26,7 +26,7 @@ class Swift_Attachment extends Swift_Mime_Attachment */ public function __construct($data = null, $filename = null, $contentType = null) { - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Mime_Attachment::__construct'], Swift_DependencyContainer::getInstance() ->createDependenciesFor('mime.attachment') diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php index 68dc3b1ec..4f3dcc377 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php @@ -52,10 +52,10 @@ class Swift_ByteStream_ArrayByteStream implements Swift_InputByteStream, Swift_O */ public function __construct($stack = null) { - if (is_array($stack)) { + if (\is_array($stack)) { $this->array = $stack; - $this->arraySize = count($stack); - } elseif (is_string($stack)) { + $this->arraySize = \count($stack); + } elseif (\is_string($stack)) { $this->write($stack); } else { $this->array = []; @@ -102,7 +102,7 @@ class Swift_ByteStream_ArrayByteStream implements Swift_InputByteStream, Swift_O foreach ($to_add as $value) { $this->array[] = $value; } - $this->arraySize = count($this->array); + $this->arraySize = \count($this->array); foreach ($this->mirrors as $stream) { $stream->write($bytes); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php index 0c428f796..f6391219e 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php @@ -81,7 +81,7 @@ class Swift_ByteStream_FileByteStream extends Swift_ByteStream_AbstractFilterabl // If we read one byte after reaching the end of the file // feof() will return false and an empty string is returned - if ('' === $bytes && feof($fp)) { + if ((false === $bytes || '' === $bytes) && feof($fp)) { $this->resetReadHandle(); return false; @@ -145,9 +145,7 @@ class Swift_ByteStream_FileByteStream extends Swift_ByteStream_AbstractFilterabl { if (!isset($this->writer)) { if (!$this->writer = fopen($this->path, $this->mode)) { - throw new Swift_IoException( - 'Unable to open file for writing ['.$this->path.']' - ); + throw new Swift_IoException('Unable to open file for writing ['.$this->path.']'); } } @@ -194,7 +192,7 @@ class Swift_ByteStream_FileByteStream extends Swift_ByteStream_AbstractFilterabl { if ($tmpFile = fopen('php://temp/maxmemory:4096', 'w+b')) { /* We have opened a php:// Stream Should work without problem */ - } elseif (function_exists('sys_get_temp_dir') && is_writable(sys_get_temp_dir()) && ($tmpFile = tmpfile())) { + } elseif (\function_exists('sys_get_temp_dir') && is_writable(sys_get_temp_dir()) && ($tmpFile = tmpfile())) { /* We have opened a tmpfile */ } else { throw new Swift_IoException('Unable to copy the file to make it seekable, sys_temp_dir is not writable, php://memory not available'); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php index b09bb5b6c..3e055afd9 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php @@ -45,7 +45,7 @@ class Swift_CharacterReader_GenericFixedWidthReader implements Swift_CharacterRe */ public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) { - $strlen = strlen($string); + $strlen = \strlen($string); // % and / are CPU intensive, so, maybe find a better way $ignored = $strlen % $this->width; $ignoredChars = $ignored ? substr($string, -$ignored) : ''; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php index 67da48f6c..ffc05f716 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php @@ -27,7 +27,7 @@ class Swift_CharacterReader_UsAsciiReader implements Swift_CharacterReader */ public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars) { - $strlen = strlen($string); + $strlen = \strlen($string); $ignoredChars = ''; for ($i = 0; $i < $strlen; ++$i) { if ($string[$i] > "\x07F") { @@ -65,7 +65,7 @@ class Swift_CharacterReader_UsAsciiReader implements Swift_CharacterReader public function validateByteSequence($bytes, $size) { $byte = reset($bytes); - if (1 == count($bytes) && $byte >= 0x00 && $byte <= 0x7F) { + if (1 == \count($bytes) && $byte >= 0x00 && $byte <= 0x7F) { return 0; } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php index 4a2df31db..da37e0da9 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php @@ -18,7 +18,7 @@ class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader { /** Pre-computed for optimization */ private static $length_map = [ - // N=0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F, + // N=0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x0N 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x1N 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x2N @@ -34,7 +34,7 @@ class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xCN 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xDN 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xEN - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0, // 0xFN + 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0, // 0xFN ]; private static $s_length_map = [ @@ -88,8 +88,8 @@ class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader $currentMap['p'] = $currentMap['i'] = []; } - $strlen = strlen($string); - $charPos = count($currentMap['p']); + $strlen = \strlen($string); + $charPos = \count($currentMap['p']); $foundChars = 0; $invalid = false; for ($i = 0; $i < $strlen; ++$i) { diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php index 78fffa987..debab675f 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php @@ -44,7 +44,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactory implements Swift public function init() { - if (count(self::$map) > 0) { + if (\count(self::$map) > 0) { return; } @@ -107,7 +107,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactory implements Swift foreach (self::$map as $pattern => $spec) { $re = '/^'.$pattern.'$/D'; if (preg_match($re, $charset)) { - if (!array_key_exists($pattern, self::$loaded)) { + if (!\array_key_exists($pattern, self::$loaded)) { $reflector = new ReflectionClass($spec['class']); if ($reflector->getConstructor()) { $reader = $reflector->newInstanceArgs($spec['constructor']); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php index 717924f5d..c9d8a078e 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream.php @@ -28,8 +28,6 @@ interface Swift_CharacterStream /** * Set the CharacterReaderFactory for multi charset support. - * - * @param Swift_CharacterReaderFactory $factory */ public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php index 887658c53..5c2869455 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php @@ -86,15 +86,15 @@ class Swift_CharacterStream_ArrayCharacterStream implements Swift_CharacterStrea $startLength = $this->charReader->getInitialByteSize(); while (false !== $bytes = $os->read($startLength)) { $c = []; - for ($i = 0, $len = strlen($bytes); $i < $len; ++$i) { + for ($i = 0, $len = \strlen($bytes); $i < $len; ++$i) { $c[] = self::$byteMap[$bytes[$i]]; } - $size = count($c); + $size = \count($c); $need = $this->charReader ->validateByteSequence($c, $size); if ($need > 0 && false !== $bytes = $os->read($need)) { - for ($i = 0, $len = strlen($bytes); $i < $len; ++$i) { + for ($i = 0, $len = \strlen($bytes); $i < $len; ++$i) { $c[] = self::$byteMap[$bytes[$i]]; } } @@ -204,7 +204,7 @@ class Swift_CharacterStream_ArrayCharacterStream implements Swift_CharacterStrea $new = $this->reloadBuffer($fp, 100); if ($new) { $buffer = array_merge($buf, $new); - $buf_len = count($buffer); + $buf_len = \count($buffer); $buf_pos = 0; } else { $has_datas = false; @@ -224,7 +224,7 @@ class Swift_CharacterStream_ArrayCharacterStream implements Swift_CharacterStrea if ($new) { $buffer = array_merge($buffer, $new); - $buf_len = count($buffer); + $buf_len = \count($buffer); } } for ($i = 0; $i < $need && isset($buffer[$buf_pos]); ++$i) { @@ -268,7 +268,7 @@ class Swift_CharacterStream_ArrayCharacterStream implements Swift_CharacterStrea { if (!feof($fp) && false !== ($bytes = fread($fp, $len))) { $buf = []; - for ($i = 0, $len = strlen($bytes); $i < $len; ++$i) { + for ($i = 0, $len = \strlen($bytes); $i < $len; ++$i) { $buf[] = self::$byteMap[$bytes[$i]]; } @@ -283,7 +283,7 @@ class Swift_CharacterStream_ArrayCharacterStream implements Swift_CharacterStrea if (!isset(self::$charMap)) { self::$charMap = []; for ($byte = 0; $byte < 256; ++$byte) { - self::$charMap[$byte] = chr($byte); + self::$charMap[$byte] = \chr($byte); } self::$byteMap = array_flip(self::$charMap); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php index a733063c9..7578dda9c 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php @@ -254,9 +254,9 @@ class Swift_CharacterStream_NgCharacterStream implements Swift_CharacterStream $this->datas .= $chars; $this->charCount += $this->charReader->getCharPositions(substr($this->datas, $this->datasSize), $this->datasSize, $this->map, $ignored); if (false !== $ignored) { - $this->datasSize = strlen($this->datas) - strlen($ignored); + $this->datasSize = \strlen($this->datas) - \strlen($ignored); } else { - $this->datasSize = strlen($this->datas); + $this->datasSize = \strlen($this->datas); } } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php index b38f8ce51..3cc885ec0 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php @@ -83,7 +83,7 @@ class Swift_DependencyContainer */ public function has($itemName) { - return array_key_exists($itemName, $this->store) + return \array_key_exists($itemName, $this->store) && isset($this->store[$itemName]['lookupType']); } @@ -101,9 +101,7 @@ class Swift_DependencyContainer public function lookup($itemName) { if (!$this->has($itemName)) { - throw new Swift_DependencyException( - 'Cannot lookup dependency "'.$itemName.'" since it is not registered.' - ); + throw new Swift_DependencyException('Cannot lookup dependency "'.$itemName.'" since it is not registered.'); } switch ($this->store[$itemName]['lookupType']) { @@ -348,9 +346,7 @@ class Swift_DependencyContainer private function &getEndPoint() { if (!isset($this->endPoint)) { - throw new BadMethodCallException( - 'Component must first be registered by calling register()' - ); + throw new BadMethodCallException('Component must first be registered by calling register()'); } return $this->endPoint; @@ -377,7 +373,7 @@ class Swift_DependencyContainer /** Resolve a single dependency with an collections */ private function lookupRecursive($item) { - if (is_array($item)) { + if (\is_array($item)) { $collection = []; foreach ($item as $k => $v) { $collection[$k] = $this->lookupRecursive($v); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php index 20b81412e..30fc68ab0 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/EmbeddedFile.php @@ -26,7 +26,7 @@ class Swift_EmbeddedFile extends Swift_Mime_EmbeddedFile */ public function __construct($data = null, $filename = null, $contentType = null) { - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Mime_EmbeddedFile::__construct'], Swift_DependencyContainer::getInstance() ->createDependenciesFor('mime.embeddedfile') diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php index 95b4ae97b..f078d6d7c 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php @@ -135,14 +135,14 @@ class Swift_Encoder_QpEncoder implements Swift_Encoder protected function getSafeMapShareId() { - return get_class($this); + return static::class; } protected function initSafeMap() { foreach (array_merge( [0x09, 0x20], range(0x21, 0x3C), range(0x3E, 0x7E)) as $byte) { - $this->safeMap[$byte] = chr($byte); + $this->safeMap[$byte] = \chr($byte); } } @@ -281,7 +281,7 @@ class Swift_Encoder_QpEncoder implements Swift_Encoder $string = str_replace(["\t=0D=0A", ' =0D=0A', '=0D=0A'], ["=09\r\n", "=20\r\n", "\r\n"], $string ); - switch ($end = ord(substr($string, -1))) { + switch ($end = \ord(substr($string, -1))) { case 0x09: case 0x20: $string = substr_replace($string, self::$qpMap[$end], -1); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php index 2458515ad..7eac36813 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php @@ -58,8 +58,8 @@ class Swift_Encoder_Rfc2231Encoder implements Swift_Encoder while (false !== $char = $this->charStream->read(4)) { $encodedChar = rawurlencode($char); - if (0 != strlen($currentLine) - && strlen($currentLine.$encodedChar) > $thisLineLength) { + if (0 != \strlen($currentLine) + && \strlen($currentLine.$encodedChar) > $thisLineLength) { $lines[] = ''; $currentLine = &$lines[$lineCount++]; $thisLineLength = $maxLineLength; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php index 7545404e7..b158eab46 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/CommandListener.php @@ -17,8 +17,6 @@ interface Swift_Events_CommandListener extends Swift_Events_EventListener { /** * Invoked immediately following a command being sent. - * - * @param Swift_Events_CommandEvent $evt */ public function commandSent(Swift_Events_CommandEvent $evt); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php index a01dfa260..c57222f24 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php @@ -18,7 +18,6 @@ interface Swift_Events_EventDispatcher /** * Create a new SendEvent for $source and $message. * - * @param Swift_Transport $source * @param Swift_Mime_SimpleMessage * * @return Swift_Events_SendEvent @@ -28,9 +27,8 @@ interface Swift_Events_EventDispatcher /** * Create a new CommandEvent for $source and $command. * - * @param Swift_Transport $source - * @param string $command That will be executed - * @param array $successCodes That are needed + * @param string $command That will be executed + * @param array $successCodes That are needed * * @return Swift_Events_CommandEvent */ @@ -39,9 +37,8 @@ interface Swift_Events_EventDispatcher /** * Create a new ResponseEvent for $source and $response. * - * @param Swift_Transport $source - * @param string $response - * @param bool $valid If the response is valid + * @param string $response + * @param bool $valid If the response is valid * * @return Swift_Events_ResponseEvent */ @@ -50,8 +47,6 @@ interface Swift_Events_EventDispatcher /** * Create a new TransportChangeEvent for $source. * - * @param Swift_Transport $source - * * @return Swift_Events_TransportChangeEvent */ public function createTransportChangeEvent(Swift_Transport $source); @@ -59,25 +54,19 @@ interface Swift_Events_EventDispatcher /** * Create a new TransportExceptionEvent for $source. * - * @param Swift_Transport $source - * @param Swift_TransportException $ex - * * @return Swift_Events_TransportExceptionEvent */ public function createTransportExceptionEvent(Swift_Transport $source, Swift_TransportException $ex); /** * Bind an event listener to this dispatcher. - * - * @param Swift_Events_EventListener $listener */ public function bindEventListener(Swift_Events_EventListener $listener); /** * Dispatch the given Event to all suitable listeners. * - * @param Swift_Events_EventObject $evt - * @param string $target method + * @param string $target method */ public function dispatchEvent(Swift_Events_EventObject $evt, $target); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php index c40919d21..85115a338 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/ResponseListener.php @@ -17,8 +17,6 @@ interface Swift_Events_ResponseListener extends Swift_Events_EventListener { /** * Invoked immediately following a response coming back. - * - * @param Swift_Events_ResponseEvent $evt */ public function responseReceived(Swift_Events_ResponseEvent $evt); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php index d922e1bfa..f7bf55ef5 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SendListener.php @@ -17,15 +17,11 @@ interface Swift_Events_SendListener extends Swift_Events_EventListener { /** * Invoked immediately before the Message is sent. - * - * @param Swift_Events_SendEvent $evt */ public function beforeSendPerformed(Swift_Events_SendEvent $evt); /** * Invoked immediately after the Message is sent. - * - * @param Swift_Events_SendEvent $evt */ public function sendPerformed(Swift_Events_SendEvent $evt); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php index 1396f6164..6557103c9 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php @@ -21,9 +21,6 @@ class Swift_Events_SimpleEventDispatcher implements Swift_Events_EventDispatcher /** Event listeners bound to this dispatcher */ private $listeners = []; - /** Listeners queued to have an Event bubbled up the stack to them */ - private $bubbleQueue = []; - /** * Create a new EventDispatcher. */ @@ -115,29 +112,31 @@ class Swift_Events_SimpleEventDispatcher implements Swift_Events_EventDispatcher */ public function dispatchEvent(Swift_Events_EventObject $evt, $target) { - $this->prepareBubbleQueue($evt); - $this->bubble($evt, $target); + $bubbleQueue = $this->prepareBubbleQueue($evt); + $this->bubble($bubbleQueue, $evt, $target); } /** Queue listeners on a stack ready for $evt to be bubbled up it */ private function prepareBubbleQueue(Swift_Events_EventObject $evt) { - $this->bubbleQueue = []; - $evtClass = get_class($evt); + $bubbleQueue = []; + $evtClass = \get_class($evt); foreach ($this->listeners as $listener) { - if (array_key_exists($evtClass, $this->eventMap) + if (\array_key_exists($evtClass, $this->eventMap) && ($listener instanceof $this->eventMap[$evtClass])) { - $this->bubbleQueue[] = $listener; + $bubbleQueue[] = $listener; } } + + return $bubbleQueue; } /** Bubble $evt up the stack calling $target() on each listener */ - private function bubble(Swift_Events_EventObject $evt, $target) + private function bubble(array &$bubbleQueue, Swift_Events_EventObject $evt, $target) { - if (!$evt->bubbleCancelled() && $listener = array_shift($this->bubbleQueue)) { + if (!$evt->bubbleCancelled() && $listener = array_shift($bubbleQueue)) { $listener->$target($evt); - $this->bubble($evt, $target); + $this->bubble($bubbleQueue, $evt, $target); } } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php index 253165de8..4a7492bc5 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php @@ -17,29 +17,21 @@ interface Swift_Events_TransportChangeListener extends Swift_Events_EventListene { /** * Invoked just before a Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt */ public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt); /** * Invoked immediately after the Transport is started. - * - * @param Swift_Events_TransportChangeEvent $evt */ public function transportStarted(Swift_Events_TransportChangeEvent $evt); /** * Invoked just before a Transport is stopped. - * - * @param Swift_Events_TransportChangeEvent $evt */ public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt); /** * Invoked immediately after the Transport is stopped. - * - * @param Swift_Events_TransportChangeEvent $evt */ public function transportStopped(Swift_Events_TransportChangeEvent $evt); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php index cc3c09937..ad80eb01d 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php @@ -17,8 +17,6 @@ interface Swift_Events_TransportExceptionListener extends Swift_Events_EventList { /** * Invoked as a TransportException is thrown in the Transport system. - * - * @param Swift_Events_TransportExceptionEvent $evt */ public function exceptionThrown(Swift_Events_TransportExceptionEvent $evt); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FailoverTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FailoverTransport.php index 0044be59b..af0be9179 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FailoverTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FailoverTransport.php @@ -22,7 +22,7 @@ class Swift_FailoverTransport extends Swift_Transport_FailoverTransport */ public function __construct($transports = []) { - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Transport_FailoverTransport::__construct'], Swift_DependencyContainer::getInstance() ->createDependenciesFor('transport.failover') diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php index d16c47cd6..7af8471c9 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/FileSpool.php @@ -198,7 +198,7 @@ class Swift_FileSpool extends Swift_ConfigurableSpool // This string MUST stay FS safe, avoid special chars $base = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-'; $ret = ''; - $strlen = strlen($base); + $strlen = \strlen($base); for ($i = 0; $i < $count; ++$i) { $ret .= $base[random_int(0, $strlen - 1)]; } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Filterable.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Filterable.php index 6b75b5274..efa1b1def 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Filterable.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Filterable.php @@ -18,8 +18,7 @@ interface Swift_Filterable /** * Add a new StreamFilter, referenced by $key. * - * @param Swift_StreamFilter $filter - * @param string $key + * @param string $key */ public function addFilter(Swift_StreamFilter $filter, $key); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php index cd6f786df..87f6a0742 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache.php @@ -38,10 +38,9 @@ interface Swift_KeyCache * * @see MODE_WRITE, MODE_APPEND * - * @param string $nsKey - * @param string $itemKey - * @param Swift_OutputByteStream $os - * @param int $mode + * @param string $nsKey + * @param string $itemKey + * @param int $mode */ public function importFromByteStream($nsKey, $itemKey, Swift_OutputByteStream $os, $mode); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php index 76fafdfc6..e8fef1c95 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php @@ -62,10 +62,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache $this->contents[$nsKey][$itemKey] .= $string; break; default: - throw new Swift_SwiftException( - 'Invalid mode ['.$mode.'] used to set nsKey='. - $nsKey.', itemKey='.$itemKey - ); + throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey); } } @@ -94,10 +91,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache } break; default: - throw new Swift_SwiftException( - 'Invalid mode ['.$mode.'] used to set nsKey='. - $nsKey.', itemKey='.$itemKey - ); + throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey); } } @@ -165,7 +159,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache { $this->prepareCache($nsKey); - return array_key_exists($itemKey, $this->contents[$nsKey]); + return \array_key_exists($itemKey, $this->contents[$nsKey]); } /** @@ -196,7 +190,7 @@ class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache */ private function prepareCache($nsKey) { - if (!array_key_exists($nsKey, $this->contents)) { + if (!\array_key_exists($nsKey, $this->contents)) { $this->contents[$nsKey] = []; } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php index 7dc2886cc..7f2962c10 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php @@ -80,10 +80,7 @@ class Swift_KeyCache_DiskKeyCache implements Swift_KeyCache $fp = $this->getHandle($nsKey, $itemKey, self::POSITION_END); break; default: - throw new Swift_SwiftException( - 'Invalid mode ['.$mode.'] used to set nsKey='. - $nsKey.', itemKey='.$itemKey - ); + throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey); break; } fwrite($fp, $string); @@ -112,10 +109,7 @@ class Swift_KeyCache_DiskKeyCache implements Swift_KeyCache $fp = $this->getHandle($nsKey, $itemKey, self::POSITION_END); break; default: - throw new Swift_SwiftException( - 'Invalid mode ['.$mode.'] used to set nsKey='. - $nsKey.', itemKey='.$itemKey - ); + throw new Swift_SwiftException('Invalid mode ['.$mode.'] used to set nsKey='.$nsKey.', itemKey='.$itemKey); break; } while (false !== $bytes = $os->read(8192)) { @@ -224,7 +218,7 @@ class Swift_KeyCache_DiskKeyCache implements Swift_KeyCache */ public function clearAll($nsKey) { - if (array_key_exists($nsKey, $this->keys)) { + if (\array_key_exists($nsKey, $this->keys)) { foreach ($this->keys[$nsKey] as $itemKey => $null) { $this->clearKey($nsKey, $itemKey); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php index af80bdca6..be2dbba0c 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php @@ -17,8 +17,6 @@ interface Swift_KeyCache_KeyCacheInputStream extends Swift_InputByteStream { /** * Set the KeyCache to wrap. - * - * @param Swift_KeyCache $keyCache */ public function setKeyCache(Swift_KeyCache $keyCache); @@ -38,8 +36,6 @@ interface Swift_KeyCache_KeyCacheInputStream extends Swift_InputByteStream /** * Specify a stream to write through for each write(). - * - * @param Swift_InputByteStream $is */ public function setWriteThroughStream(Swift_InputByteStream $is); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php index ce732af5f..244b5f602 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php @@ -22,7 +22,7 @@ class Swift_LoadBalancedTransport extends Swift_Transport_LoadBalancedTransport */ public function __construct($transports = []) { - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Transport_LoadBalancedTransport::__construct'], Swift_DependencyContainer::getInstance() ->createDependenciesFor('transport.loadbalanced') diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php index 42b861fc1..819ffc389 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php @@ -42,7 +42,7 @@ class Swift_Message extends Swift_Mime_SimpleMessage */ public function __construct($subject = null, $body = null, $contentType = null, $charset = null) { - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Mime_SimpleMessage::__construct'], Swift_DependencyContainer::getInstance() ->createDependenciesFor('mime.message') @@ -212,7 +212,7 @@ class Swift_Message extends Swift_Mime_SimpleMessage $this->savedMessage = ['headers' => []]; $this->savedMessage['body'] = $this->getBody(); $this->savedMessage['children'] = $this->getChildren(); - if (count($this->savedMessage['children']) > 0 && '' != $this->getBody()) { + if (\count($this->savedMessage['children']) > 0 && '' != $this->getBody()) { $this->setChildren(array_merge([$this->becomeMimePart()], $this->savedMessage['children'])); $this->setBody(''); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php index 917007e46..d994373bd 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Attachment.php @@ -134,7 +134,7 @@ class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity if (!isset($contentType)) { $extension = strtolower(substr($file->getPath(), strrpos($file->getPath(), '.') + 1)); - if (array_key_exists($extension, $this->mimeTypes)) { + if (\array_key_exists($extension, $this->mimeTypes)) { $this->setContentType($this->mimeTypes[$extension]); } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php index 8c4e2266f..2751130d4 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php @@ -46,7 +46,7 @@ class Swift_Mime_ContentEncoder_Base64ContentEncoder extends Swift_Encoder_Base6 $streamTheseBytes = $base64ReadBufferRemainderBytes.$readBytes; } $base64ReadBufferRemainderBytes = null; - $bytesLength = strlen($streamTheseBytes); + $bytesLength = \strlen($streamTheseBytes); if (0 === $bytesLength) { // no data left to encode break; @@ -66,7 +66,7 @@ class Swift_Mime_ContentEncoder_Base64ContentEncoder extends Swift_Encoder_Base6 $encodedTransformed = ''; $thisMaxLineLength = $maxLineLength - $remainder - $firstLineOffset; - while ($thisMaxLineLength < strlen($encoded)) { + while ($thisMaxLineLength < \strlen($encoded)) { $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength)."\r\n"; $firstLineOffset = 0; $encoded = substr($encoded, $thisMaxLineLength); @@ -74,7 +74,7 @@ class Swift_Mime_ContentEncoder_Base64ContentEncoder extends Swift_Encoder_Base6 $remainder = 0; } - if (0 < $remainingLength = strlen($encoded)) { + if (0 < $remainingLength = \strlen($encoded)) { $remainder += $remainingLength; $encodedTransformed .= $encoded; $encoded = null; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php index 9aae48718..8dfea605f 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php @@ -16,16 +16,16 @@ class Swift_Mime_ContentEncoder_NativeQpContentEncoder implements Swift_Mime_ContentEncoder { /** - * @var null|string + * @var string|null */ private $charset; /** - * @param null|string $charset + * @param string|null $charset */ public function __construct($charset = null) { - $this->charset = $charset ? $charset : 'utf-8'; + $this->charset = $charset ?: 'utf-8'; } /** @@ -51,8 +51,7 @@ class Swift_Mime_ContentEncoder_NativeQpContentEncoder implements Swift_Mime_Con public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0) { if ('utf-8' !== $this->charset) { - throw new RuntimeException( - sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset)); + throw new RuntimeException(sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset)); } $string = ''; @@ -88,8 +87,7 @@ class Swift_Mime_ContentEncoder_NativeQpContentEncoder implements Swift_Mime_Con public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0) { if ('utf-8' !== $this->charset) { - throw new RuntimeException( - sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset)); + throw new RuntimeException(sprintf('Charset "%s" not supported. NativeQpContentEncoder only supports "utf-8"', $this->charset)); } return $this->standardize(quoted_printable_encode($string)); @@ -109,7 +107,7 @@ class Swift_Mime_ContentEncoder_NativeQpContentEncoder implements Swift_Mime_Con // transform =0D=0A to CRLF $string = str_replace(["\t=0D=0A", ' =0D=0A', '=0D=0A'], ["=09\r\n", "=20\r\n", "\r\n"], $string); - switch (ord(substr($string, -1))) { + switch (\ord(substr($string, -1))) { case 0x09: $string = substr_replace($string, '=09', -1); break; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php index aa634f54e..72592fc58 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php @@ -37,7 +37,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten * Creates a new PlainContentEncoder with $name (probably 7bit or 8bit). * * @param string $name - * @param bool $canonical If canonicalization transformation should be done. + * @param bool $canonical if canonicalization transformation should be done */ public function __construct($name, $canonical = false) { @@ -84,7 +84,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten $is->write($wrapped); } - if (strlen($leftOver)) { + if (\strlen($leftOver)) { $is->write($leftOver); } } @@ -134,8 +134,8 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten $chunks = preg_split('/(?<=\s)/', $originalLine); foreach ($chunks as $chunk) { - if (0 != strlen($currentLine) - && strlen($currentLine.$chunk) > $length) { + if (0 != \strlen($currentLine) + && \strlen($currentLine.$chunk) > $length) { $lines[] = ''; $currentLine = &$lines[$lineCount++]; } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php index 84e3d2475..465ffd878 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php @@ -37,7 +37,7 @@ class Swift_Mime_ContentEncoder_QpContentEncoder extends Swift_Encoder_QpEncoder protected function getSafeMapShareId() { - return get_class($this).($this->dotEscape ? '.dotEscape' : ''); + return static::class.($this->dotEscape ? '.dotEscape' : ''); } protected function initSafeMap() @@ -116,7 +116,7 @@ class Swift_Mime_ContentEncoder_QpContentEncoder extends Swift_Encoder_QpEncoder $lineLen = $size - strrpos($enc, '=0D=0A') - 6; } } - if (strlen($currentLine)) { + if (\strlen($currentLine)) { $is->write($prepend.$this->standardize($currentLine)); } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php index 1b06da8c7..f3ece43ae 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php @@ -28,7 +28,7 @@ class Swift_Mime_ContentEncoder_QpContentEncoderProxy implements Swift_Mime_Cont private $nativeEncoder; /** - * @var null|string + * @var string|null */ private $charset; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php index cc44a6efb..1a952ece1 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php @@ -17,8 +17,6 @@ interface Swift_Mime_EncodingObserver { /** * Notify this observer that the observed entity's ContentEncoder has changed. - * - * @param Swift_Mime_ContentEncoder $encoder */ public function encoderChanged(Swift_Mime_ContentEncoder $encoder); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php index 0eef3e1e7..378c48050 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php @@ -31,7 +31,7 @@ class Swift_Mime_HeaderEncoder_QpHeaderEncoder extends Swift_Encoder_QpEncoder i range(0x61, 0x7A), range(0x41, 0x5A), range(0x30, 0x39), [0x20, 0x21, 0x2A, 0x2B, 0x2D, 0x2F] ) as $byte) { - $this->safeMap[$byte] = chr($byte); + $this->safeMap[$byte] = \chr($byte); } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php index 3a19404a6..22caeb236 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php @@ -216,7 +216,7 @@ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header // ... otherwise it needs encoding // Determine space remaining on line if first line if ($shorten) { - $usedLength = strlen($header->getFieldName().': '); + $usedLength = \strlen($header->getFieldName().': '); } else { $usedLength = 0; } @@ -271,7 +271,7 @@ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header } if (-1 == $usedLength) { - $usedLength = strlen($header->getFieldName().': ') + strlen($value); + $usedLength = \strlen($header->getFieldName().': ') + \strlen($value); } $value .= $this->getTokenAsEncodedWord($token, $usedLength); @@ -313,14 +313,14 @@ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header if ($this->tokenNeedsEncoding($token)) { $encodedToken .= $token; } else { - if (strlen($encodedToken) > 0) { + if (\strlen($encodedToken) > 0) { $tokens[] = $encodedToken; $encodedToken = ''; } $tokens[] = $token; } } - if (strlen($encodedToken)) { + if (\strlen($encodedToken)) { $tokens[] = $encodedToken; } @@ -342,7 +342,7 @@ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header if (isset($this->lang)) { $charsetDecl .= '*'.$this->lang; } - $encodingWrapperLength = strlen( + $encodingWrapperLength = \strlen( '=?'.$charsetDecl.'?'.$this->encoder->getName().'??=' ); @@ -458,8 +458,8 @@ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header foreach ($tokens as $i => $token) { // Line longer than specified maximum or token was just a new line if (("\r\n" == $token) || - ($i > 0 && strlen($currentLine.$token) > $this->lineLength) - && 0 < strlen($currentLine)) { + ($i > 0 && \strlen($currentLine.$token) > $this->lineLength) + && 0 < \strlen($currentLine)) { $headerLines[] = ''; $currentLine = &$headerLines[$lineCount++]; } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php index cadc63f85..dcea0c9cc 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php @@ -96,7 +96,7 @@ class Swift_Mime_Headers_IdentificationHeader extends Swift_Mime_Headers_Abstrac */ public function setId($id) { - $this->setIds(is_array($id) ? $id : [$id]); + $this->setIds(\is_array($id) ? $id : [$id]); } /** @@ -108,7 +108,7 @@ class Swift_Mime_Headers_IdentificationHeader extends Swift_Mime_Headers_Abstrac */ public function getId() { - if (count($this->ids) > 0) { + if (\count($this->ids) > 0) { return $this->ids[0]; } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php index 9f1fe1749..ddd5e8cff 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php @@ -261,7 +261,7 @@ class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader $actualMailboxes = []; foreach ($mailboxes as $key => $value) { - if (is_string($key)) { + if (\is_string($key)) { //key is email addr $address = $key; $name = $value; @@ -347,14 +347,12 @@ class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader * * @param string $address * - * @throws Swift_RfcComplianceException If invalid. + * @throws Swift_RfcComplianceException if invalid */ private function assertValidAddress($address) { if (!$this->emailValidator->isValid($address, new RFCValidation())) { - throw new Swift_RfcComplianceException( - 'Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.' - ); + throw new Swift_RfcComplianceException('Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'); } } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php index 02933c417..47c15e6c0 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php @@ -155,7 +155,7 @@ class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_Unstruct foreach ($this->params as $name => $value) { if (null !== $value) { // Add the semi-colon separator - $tokens[count($tokens) - 1] .= ';'; + $tokens[\count($tokens) - 1] .= ';'; $tokens = array_merge($tokens, $this->generateTokenLines( ' '.$this->createParameter($name, $value) )); @@ -179,7 +179,7 @@ class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_Unstruct $encoded = false; // Allow room for parameter name, indices, "=" and DQUOTEs - $maxValueLength = $this->getMaxLineLength() - strlen($name.'=*N"";') - 1; + $maxValueLength = $this->getMaxLineLength() - \strlen($name.'=*N"";') - 1; $firstLineOffset = 0; // If it's not already a valid parameter value... @@ -189,15 +189,15 @@ class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_Unstruct if (!preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $value)) { $encoded = true; // Allow space for the indices, charset and language - $maxValueLength = $this->getMaxLineLength() - strlen($name.'*N*="";') - 1; - $firstLineOffset = strlen( + $maxValueLength = $this->getMaxLineLength() - \strlen($name.'*N*="";') - 1; + $firstLineOffset = \strlen( $this->getCharset()."'".$this->getLanguage()."'" ); } } // Encode if we need to - if ($encoded || strlen($value) > $maxValueLength) { + if ($encoded || \strlen($value) > $maxValueLength) { if (isset($this->paramEncoder)) { $value = $this->paramEncoder->encodeString( $origValue, $firstLineOffset, $maxValueLength, $this->getCharset() @@ -212,7 +212,7 @@ class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_Unstruct $valueLines = isset($this->paramEncoder) ? explode("\r\n", $value) : [$value]; // Need to add indices - if (count($valueLines) > 1) { + if (\count($valueLines) > 1) { $paramLines = []; foreach ($valueLines as $i => $line) { $paramLines[] = $name.'*'.$i. diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php index d22afbfe9..81b421ee7 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php @@ -147,9 +147,7 @@ class Swift_Mime_Headers_PathHeader extends Swift_Mime_Headers_AbstractHeader private function assertValidAddress($address) { if (!$this->emailValidator->isValid($address, new RFCValidation())) { - throw new Swift_RfcComplianceException( - 'Address set in PathHeader does not comply with addr-spec of RFC 2822.' - ); + throw new Swift_RfcComplianceException('Address set in PathHeader does not comply with addr-spec of RFC 2822.'); } } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php index 0acfd4e27..fa0726a35 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/MimePart.php @@ -169,7 +169,7 @@ class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity protected function fixHeaders() { parent::fixHeaders(); - if (count($this->getChildren())) { + if (\count($this->getChildren())) { $this->setHeaderParameter('Content-Type', 'charset', null); $this->setHeaderParameter('Content-Type', 'format', null); $this->setHeaderParameter('Content-Type', 'delsp', null); @@ -190,7 +190,7 @@ class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity protected function convertString($string) { $charset = strtolower($this->getCharset()); - if (!in_array($charset, ['utf-8', 'iso-8859-1', 'iso-8859-15', ''])) { + if (!\in_array($charset, ['utf-8', 'iso-8859-1', 'iso-8859-15', ''])) { return mb_convert_encoding($string, $charset, 'utf-8'); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php index 93af99634..b4345f439 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php @@ -68,8 +68,7 @@ class Swift_Mime_SimpleHeaderFactory implements Swift_Mime_CharsetObserver /** * Create a new Date header using $dateTime. * - * @param string $name - * @param DateTimeInterface|null $dateTime + * @param string $name * * @return Swift_Mime_Header */ diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php index a2c319131..d55cf66a7 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php @@ -140,16 +140,16 @@ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_CharsetObserver { $lowerName = strtolower($name); - if (!array_key_exists($lowerName, $this->headers)) { + if (!\array_key_exists($lowerName, $this->headers)) { return false; } - if (func_num_args() < 2) { + if (\func_num_args() < 2) { // index was not specified, so we only need to check that there is at least one header value set - return (bool) count($this->headers[$lowerName]); + return (bool) \count($this->headers[$lowerName]); } - return array_key_exists($index, $this->headers[$lowerName]); + return \array_key_exists($index, $this->headers[$lowerName]); } /** @@ -183,7 +183,7 @@ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_CharsetObserver { $name = strtolower($name); - if (func_num_args() < 2) { + if (\func_num_args() < 2) { if ($this->has($name)) { $values = array_values($this->headers[$name]); @@ -215,7 +215,7 @@ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_CharsetObserver } $lowerName = strtolower($name); - if (!array_key_exists($lowerName, $this->headers)) { + if (!\array_key_exists($lowerName, $this->headers)) { return []; } @@ -343,7 +343,7 @@ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_CharsetObserver /** Test if the headers can be sorted */ private function canSort() { - return count($this->order) > 0; + return \count($this->order) > 0; } /** uksort() algorithm for Header ordering */ @@ -351,8 +351,8 @@ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_CharsetObserver { $lowerA = strtolower($a); $lowerB = strtolower($b); - $aPos = array_key_exists($lowerA, $this->order) ? $this->order[$lowerA] : -1; - $bPos = array_key_exists($lowerB, $this->order) ? $this->order[$lowerB] : -1; + $aPos = \array_key_exists($lowerA, $this->order) ? $this->order[$lowerA] : -1; + $bPos = \array_key_exists($lowerB, $this->order) ? $this->order[$lowerB] : -1; if (-1 === $aPos && -1 === $bPos) { // just be sure to be determinist here @@ -371,7 +371,7 @@ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_CharsetObserver /** Test if the given Header is always displayed */ private function isDisplayed(Swift_Mime_Header $header) { - return array_key_exists(strtolower($header->getFieldName()), $this->required); + return \array_key_exists(strtolower($header->getFieldName()), $this->required); } /** Notify all Headers of the new charset */ diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php index ab32f63fe..62da1650a 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php @@ -152,7 +152,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart */ public function setSender($address, $name = null) { - if (!is_array($address) && isset($name)) { + if (!\is_array($address) && isset($name)) { $address = [$address => $name]; } @@ -206,7 +206,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart */ public function setFrom($addresses, $name = null) { - if (!is_array($addresses) && isset($name)) { + if (!\is_array($addresses) && isset($name)) { $addresses = [$addresses => $name]; } @@ -260,7 +260,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart */ public function setReplyTo($addresses, $name = null) { - if (!is_array($addresses) && isset($name)) { + if (!\is_array($addresses) && isset($name)) { $addresses = [$addresses => $name]; } @@ -315,7 +315,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart */ public function setTo($addresses, $name = null) { - if (!is_array($addresses) && isset($name)) { + if (!\is_array($addresses) && isset($name)) { $addresses = [$addresses => $name]; } @@ -367,7 +367,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart */ public function setCc($addresses, $name = null) { - if (!is_array($addresses) && isset($name)) { + if (!\is_array($addresses) && isset($name)) { $addresses = [$addresses => $name]; } @@ -419,7 +419,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart */ public function setBcc($addresses, $name = null) { - if (!is_array($addresses) && isset($name)) { + if (!\is_array($addresses) && isset($name)) { $addresses = [$addresses => $name]; } @@ -568,7 +568,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart */ public function toString() { - if (count($children = $this->getChildren()) > 0 && '' != $this->getBody()) { + if (\count($children = $this->getChildren()) > 0 && '' != $this->getBody()) { $this->setChildren(array_merge([$this->becomeMimePart()], $children)); $string = parent::toString(); $this->setChildren($children); @@ -596,7 +596,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart */ public function toByteStream(Swift_InputByteStream $is) { - if (count($children = $this->getChildren()) > 0 && '' != $this->getBody()) { + if (\count($children = $this->getChildren()) > 0 && '' != $this->getBody()) { $this->setChildren(array_merge([$this->becomeMimePart()], $children)); parent::toByteStream($is); $this->setChildren($children); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php index 63dda3d6e..6ee4b7e43 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php @@ -634,7 +634,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_CharsetObserver, Swift_M */ protected function fixHeaders() { - if (count($this->immediateChildren)) { + if (\count($this->immediateChildren)) { $this->setHeaderParameter('Content-Type', 'boundary', $this->getBoundary() ); @@ -778,7 +778,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_CharsetObserver, Swift_M $sorted = []; foreach ($this->immediateChildren as $child) { $type = $child->getContentType(); - $level = array_key_exists($type, $this->alternativePartOrder) ? $this->alternativePartOrder[$type] : max($this->alternativePartOrder) + 1; + $level = \array_key_exists($type, $this->alternativePartOrder) ? $this->alternativePartOrder[$type] : max($this->alternativePartOrder) + 1; if (empty($sorted[$level])) { $sorted[$level] = []; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php index 14f84324a..ea97619ad 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/MimePart.php @@ -26,7 +26,7 @@ class Swift_MimePart extends Swift_Mime_MimePart */ public function __construct($body = null, $contentType = null, $charset = null) { - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Mime_MimePart::__construct'], Swift_DependencyContainer::getInstance() ->createDependenciesFor('mime.part') diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php index eefb9a6f7..e44b7af98 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/NullTransport.php @@ -17,7 +17,7 @@ class Swift_NullTransport extends Swift_Transport_NullTransport { public function __construct() { - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Transport_NullTransport::__construct'], Swift_DependencyContainer::getInstance() ->createDependenciesFor('transport.null') diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php index f7a24dd00..36451f44f 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php @@ -54,7 +54,7 @@ class Swift_Plugins_BandwidthMonitorPlugin implements Swift_Events_SendListener, public function commandSent(Swift_Events_CommandEvent $evt) { $command = $evt->getCommand(); - $this->out += strlen($command); + $this->out += \strlen($command); } /** @@ -63,7 +63,7 @@ class Swift_Plugins_BandwidthMonitorPlugin implements Swift_Events_SendListener, public function responseReceived(Swift_Events_ResponseEvent $evt) { $response = $evt->getResponse(); - $this->in += strlen($response); + $this->in += \strlen($response); } /** @@ -73,7 +73,7 @@ class Swift_Plugins_BandwidthMonitorPlugin implements Swift_Events_SendListener, */ public function write($bytes) { - $this->out += strlen($bytes); + $this->out += \strlen($bytes); foreach ($this->mirrors as $stream) { $stream->write($bytes); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php index c4b6ee127..93124c9a5 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php @@ -96,20 +96,20 @@ class Swift_Plugins_DecoratorPlugin implements Swift_Events_SendListener, Swift_ foreach ($message->getHeaders()->getAll() as $header) { $body = $header->getFieldBodyModel(); $count = 0; - if (is_array($body)) { + if (\is_array($body)) { $bodyReplaced = []; foreach ($body as $key => $value) { $count1 = 0; $count2 = 0; - $key = is_string($key) ? str_replace($search, $replace, $key, $count1) : $key; - $value = is_string($value) ? str_replace($search, $replace, $value, $count2) : $value; + $key = \is_string($key) ? str_replace($search, $replace, $key, $count1) : $key; + $value = \is_string($value) ? str_replace($search, $replace, $value, $count2) : $value; $bodyReplaced[$key] = $value; if (!$count && ($count1 || $count2)) { $count = 1; } } - } elseif (is_string($body)) { + } elseif (\is_string($body)) { $bodyReplaced = str_replace($search, $replace, $body, $count); } @@ -178,7 +178,7 @@ class Swift_Plugins_DecoratorPlugin implements Swift_Events_SendListener, Swift_ } if (!empty($this->originalHeaders)) { foreach ($message->getHeaders()->getAll() as $header) { - if (array_key_exists($header->getFieldName(), $this->originalHeaders)) { + if (\array_key_exists($header->getFieldName(), $this->originalHeaders)) { $header->setFieldBodyModel($this->originalHeaders[$header->getFieldName()]); } } @@ -188,7 +188,7 @@ class Swift_Plugins_DecoratorPlugin implements Swift_Events_SendListener, Swift_ $children = (array) $message->getChildren(); foreach ($children as $child) { $id = $child->getId(); - if (array_key_exists($id, $this->originalChildBodies)) { + if (\array_key_exists($id, $this->originalChildBodies)) { $child->setBody($this->originalChildBodies[$id]); } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php index c70a03824..e183749b7 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php @@ -77,7 +77,7 @@ class Swift_Plugins_LoggerPlugin implements Swift_Events_CommandListener, Swift_ */ public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt) { - $transportName = get_class($evt->getSource()); + $transportName = \get_class($evt->getSource()); $this->logger->add(sprintf('++ Starting %s', $transportName)); } @@ -86,7 +86,7 @@ class Swift_Plugins_LoggerPlugin implements Swift_Events_CommandListener, Swift_ */ public function transportStarted(Swift_Events_TransportChangeEvent $evt) { - $transportName = get_class($evt->getSource()); + $transportName = \get_class($evt->getSource()); $this->logger->add(sprintf('++ %s started', $transportName)); } @@ -95,7 +95,7 @@ class Swift_Plugins_LoggerPlugin implements Swift_Events_CommandListener, Swift_ */ public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt) { - $transportName = get_class($evt->getSource()); + $transportName = \get_class($evt->getSource()); $this->logger->add(sprintf('++ Stopping %s', $transportName)); } @@ -104,7 +104,7 @@ class Swift_Plugins_LoggerPlugin implements Swift_Events_CommandListener, Swift_ */ public function transportStopped(Swift_Events_TransportChangeEvent $evt) { - $transportName = get_class($evt->getSource()); + $transportName = \get_class($evt->getSource()); $this->logger->add(sprintf('++ %s stopped', $transportName)); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php index b00bcaa11..6f595adaa 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php @@ -47,7 +47,7 @@ class Swift_Plugins_Loggers_ArrayLogger implements Swift_Plugins_Logger public function add($entry) { $this->log[] = $entry; - while (count($this->log) > $this->size) { + while (\count($this->log) > $this->size) { array_shift($this->log); } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php index 3b4de80ec..39c48ed18 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php @@ -42,7 +42,7 @@ class Swift_Plugins_MessageLogger implements Swift_Events_SendListener */ public function countMessages() { - return count($this->messages); + return \count($this->messages); } /** diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php index 1d5da1c64..1ecfce050 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php @@ -132,16 +132,12 @@ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeL if (!isset($this->socket)) { if (!$socket = fsockopen( $this->getHostString(), $this->port, $errno, $errstr, $this->timeout)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to connect to POP3 host [%s]: %s', $this->host, $errstr) - ); + throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to connect to POP3 host [%s]: %s', $this->host, $errstr)); } $this->socket = $socket; if (false === $greeting = fgets($this->socket)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to connect to POP3 host [%s]', trim($greeting)) - ); + throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to connect to POP3 host [%s]', trim($greeting))); } $this->assertOk($greeting); @@ -164,9 +160,7 @@ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeL } else { $this->command("QUIT\r\n"); if (!fclose($this->socket)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('POP3 host [%s] connection could not be stopped', $this->host) - ); + throw new Swift_Plugins_Pop_Pop3Exception(sprintf('POP3 host [%s] connection could not be stopped', $this->host)); } $this->socket = null; } @@ -211,15 +205,11 @@ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeL private function command($command) { if (!fwrite($this->socket, $command)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to write command [%s] to POP3 host', trim($command)) - ); + throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to write command [%s] to POP3 host', trim($command))); } if (false === $response = fgets($this->socket)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('Failed to read from POP3 host after command [%s]', trim($command)) - ); + throw new Swift_Plugins_Pop_Pop3Exception(sprintf('Failed to read from POP3 host after command [%s]', trim($command))); } $this->assertOk($response); @@ -230,9 +220,7 @@ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeL private function assertOk($response) { if ('+OK' != substr($response, 0, 3)) { - throw new Swift_Plugins_Pop_Pop3Exception( - sprintf('POP3 command failed [%s]', trim($response)) - ); + throw new Swift_Plugins_Pop_Pop3Exception(sprintf('POP3 command failed [%s]', trim($response))); } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php index b0cb519e0..f7373b242 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php @@ -112,7 +112,7 @@ class Swift_Plugins_RedirectingPlugin implements Swift_Events_SendListener } foreach ((array) $this->recipient as $recipient) { - if (!array_key_exists($recipient, $to)) { + if (!\array_key_exists($recipient, $to)) { $message->addTo($recipient); } } @@ -155,7 +155,7 @@ class Swift_Plugins_RedirectingPlugin implements Swift_Events_SendListener */ protected function isWhitelisted($recipient) { - if (in_array($recipient, (array) $this->recipient)) { + if (\in_array($recipient, (array) $this->recipient)) { return true; } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php index 3a2b6657c..b88183397 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/Reporter.php @@ -24,9 +24,8 @@ interface Swift_Plugins_Reporter /** * Notifies this ReportNotifier that $address failed or succeeded. * - * @param Swift_Mime_SimpleMessage $message - * @param string $address - * @param int $result from {@link RESULT_PASS, RESULT_FAIL} + * @param string $address + * @param int $result from {@link RESULT_PASS, RESULT_FAIL} */ public function notify(Swift_Mime_SimpleMessage $message, $address, $result); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php index ae070eb64..c4a016520 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php @@ -45,13 +45,13 @@ class Swift_Plugins_ReporterPlugin implements Swift_Events_SendListener $message = $evt->getMessage(); $failures = array_flip($evt->getFailedRecipients()); foreach ((array) $message->getTo() as $address => $null) { - $this->reporter->notify($message, $address, (array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS)); + $this->reporter->notify($message, $address, (\array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS)); } foreach ((array) $message->getCc() as $address => $null) { - $this->reporter->notify($message, $address, (array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS)); + $this->reporter->notify($message, $address, (\array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS)); } foreach ((array) $message->getBcc() as $address => $null) { - $this->reporter->notify($message, $address, (array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS)); + $this->reporter->notify($message, $address, (\array_key_exists($address, $failures) ? Swift_Plugins_Reporter::RESULT_FAIL : Swift_Plugins_Reporter::RESULT_PASS)); } } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SendmailTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SendmailTransport.php index 2aa7e3261..3c756436c 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SendmailTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SendmailTransport.php @@ -22,7 +22,7 @@ class Swift_SendmailTransport extends Swift_Transport_SendmailTransport */ public function __construct($command = '/usr/sbin/sendmail -bs') { - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Transport_SendmailTransport::__construct'], Swift_DependencyContainer::getInstance() ->createDependenciesFor('transport.sendmail') diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php index 8e66e18f4..b25c427af 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/BodySigner.php @@ -18,8 +18,6 @@ interface Swift_Signers_BodySigner extends Swift_Signer /** * Change the Swift_Signed_Message to apply the singing. * - * @param Swift_Message $message - * * @return self */ public function signMessage(Swift_Message $message); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php index 7f1bf4a5f..9a26abd35 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php @@ -295,7 +295,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner break; case 'rsa-sha256': $this->hashAlgorithm = 'rsa-sha256'; - if (!defined('OPENSSL_ALGO_SHA256')) { + if (!\defined('OPENSSL_ALGO_SHA256')) { throw new Swift_SwiftException('Unable to set sha256 as it is not supported by OpenSSL.'); } break; @@ -574,7 +574,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner protected function canonicalizeBody($string) { - $len = strlen($string); + $len = \strlen($string); $canon = ''; $method = ('relaxed' == $this->bodyCanon); for ($i = 0; $i < $len; ++$i) { @@ -629,7 +629,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner protected function endOfBody() { // Add trailing Line return if last line is non empty - if (strlen($this->bodyCanonLine) > 0) { + if (\strlen($this->bodyCanonLine) > 0) { $this->addToBodyHash("\r\n"); } $this->bodyHash = hash_final($this->bodyHashHandler, true); @@ -637,7 +637,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner private function addToBodyHash($string) { - $len = strlen($string); + $len = \strlen($string); if ($len > ($new_len = ($this->maxLen - $this->bodyLen))) { $string = substr($string, 0, $new_len); $len = $new_len; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php index a24d2032d..8833765b3 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php @@ -412,7 +412,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner protected function canonicalizeBody($string) { - $len = strlen($string); + $len = \strlen($string); $canon = ''; $nofws = ('nofws' == $this->canon); for ($i = 0; $i < $len; ++$i) { @@ -462,7 +462,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner protected function endOfBody() { - if (strlen($this->bodyCanonLine) > 0) { + if (\strlen($this->bodyCanonLine) > 0) { $this->addToHash("\r\n"); } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php index 6104e34f3..6f5c20923 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php @@ -41,8 +41,6 @@ interface Swift_Signers_HeaderSigner extends Swift_Signer, Swift_InputByteStream /** * Give the headers already given. * - * @param Swift_Mime_SimpleHeaderSet $headers - * * @return self */ public function setHeaders(Swift_Mime_SimpleHeaderSet $headers); @@ -50,8 +48,6 @@ interface Swift_Signers_HeaderSigner extends Swift_Signer, Swift_InputByteStream /** * Add the header(s) to the headerSet. * - * @param Swift_Mime_SimpleHeaderSet $headers - * * @return self */ public function addSignature(Swift_Mime_SimpleHeaderSet $headers); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php index 7b50c51d4..6d7b589cb 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php @@ -31,7 +31,7 @@ class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner public function __construct($privateKey, $domainName, $selector) { - if (!extension_loaded('opendkim')) { + if (!\extension_loaded('opendkim')) { throw new Swift_SwiftException('php-opendkim extension not found'); } @@ -44,7 +44,7 @@ class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner { $header = new Swift_Mime_Headers_OpenDKIMHeader('DKIM-Signature'); $headerVal = $this->dkimHandler->getSignatureHeader(); - if (false === $headerVal || is_int($headerVal)) { + if (false === $headerVal || \is_int($headerVal)) { throw new Swift_SwiftException('OpenDKIM Error: '.$this->dkimHandler->getError()); } $header->setValue($headerVal); @@ -176,7 +176,7 @@ class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner } } $this->dropFirstLF = false; - if (strlen($string)) { + if (\strlen($string)) { $this->dkimHandler->body($string); } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php index 84c53edb5..30f3cbdf6 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php @@ -80,7 +80,7 @@ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner $this->signCertificate = 'file://'.str_replace('\\', '/', realpath($certificate)); if (null !== $privateKey) { - if (is_array($privateKey)) { + if (\is_array($privateKey)) { $this->signPrivateKey = $privateKey; $this->signPrivateKey[0] = 'file://'.str_replace('\\', '/', realpath($privateKey[0])); } else { @@ -107,7 +107,7 @@ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner */ public function setEncryptCertificate($recipientCerts, $cipher = null) { - if (is_array($recipientCerts)) { + if (\is_array($recipientCerts)) { $this->encryptCert = []; foreach ($recipientCerts as $cert) { @@ -509,7 +509,7 @@ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner $bodyStream = new Swift_ByteStream_TemporaryFileByteStream(); // Skip the header and separator and point to the body - $emailStream->setReadPointer($headersPosEnd + strlen($headerBodySeparator)); + $emailStream->setReadPointer($headersPosEnd + \strlen($headerBodySeparator)); while (false !== ($buffer = $emailStream->read($bufferLength))) { $bodyStream->write($buffer); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php index e241e6786..726b468eb 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SmtpTransport.php @@ -29,7 +29,7 @@ class Swift_SmtpTransport extends Swift_Transport_EsmtpTransport */ public function __construct($host = 'localhost', $port = 25, $encryption = null) { - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Transport_EsmtpTransport::__construct'], Swift_DependencyContainer::getInstance() ->createDependenciesFor('transport.smtp') diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php index 4b30f04ed..c08e0fb17 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/SpoolTransport.php @@ -25,7 +25,7 @@ class Swift_SpoolTransport extends Swift_Transport_SpoolTransport $arguments[] = $spool; - call_user_func_array( + \call_user_func_array( [$this, 'Swift_Transport_SpoolTransport::__construct'], $arguments ); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php index c3b7675dd..7e5ddf1b7 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php @@ -49,11 +49,11 @@ class Swift_StreamFilters_ByteArrayReplacementFilter implements Swift_StreamFilt $last_size = $size = 0; foreach ($search as $i => $search_element) { if (null !== $tree) { - $tree[-1] = min(count($replace) - 1, $i - 1); + $tree[-1] = min(\count($replace) - 1, $i - 1); $tree[-2] = $last_size; } $tree = &$this->tree; - if (is_array($search_element)) { + if (\is_array($search_element)) { foreach ($search_element as $k => $char) { $this->index[$char] = true; if (!isset($tree[$char])) { @@ -74,19 +74,19 @@ class Swift_StreamFilters_ByteArrayReplacementFilter implements Swift_StreamFilt } } if (null !== $i) { - $tree[-1] = min(count($replace) - 1, $i); + $tree[-1] = min(\count($replace) - 1, $i); $tree[-2] = $last_size; $this->treeMaxLen = $size; } foreach ($replace as $rep) { - if (!is_array($rep)) { + if (!\is_array($rep)) { $rep = [$rep]; } $this->replace[] = $rep; } - for ($i = count($this->replace) - 1; $i >= 0; --$i) { + for ($i = \count($this->replace) - 1; $i >= 0; --$i) { $this->replace[$i] = $rep = $this->filter($this->replace[$i], $i); - $this->repSize[$i] = count($rep); + $this->repSize[$i] = \count($rep); } } @@ -119,7 +119,7 @@ class Swift_StreamFilters_ByteArrayReplacementFilter implements Swift_StreamFilt } $newBuffer = []; - $buf_size = count($buffer); + $buf_size = \count($buffer); $last_size = 0; for ($i = 0; $i < $buf_size; ++$i) { $search_pos = $this->tree; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport.php index 0951f35e7..bc324e868 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport.php @@ -63,8 +63,7 @@ interface Swift_Transport * * This is the responsibility of the send method to start the transport if needed. * - * @param Swift_Mime_SimpleMessage $message - * @param string[] $failedRecipients An array of failures by-reference + * @param string[] $failedRecipients An array of failures by-reference * * @return int */ @@ -72,8 +71,6 @@ interface Swift_Transport /** * Register a plugin in the Transport. - * - * @param Swift_Events_EventListener $plugin */ public function registerPlugin(Swift_Events_EventListener $plugin); } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php index 18c8d9b90..82b86e482 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php @@ -210,7 +210,7 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport } if ($evt) { - if ($sent == count($to) + count($cc) + count($bcc)) { + if ($sent == \count($to) + \count($cc) + \count($bcc)) { $evt->setResult(Swift_Events_SendEvent::RESULT_SUCCESS); } elseif ($sent > 0) { $evt->setResult(Swift_Events_SendEvent::RESULT_TENTATIVE); @@ -318,7 +318,7 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport * @param int[] $codes * @param string[] $failures An array of failures by-reference * @param bool $pipeline Do not wait for response - * @param string $address The address, if command is RCPT TO. + * @param string $address the address, if command is RCPT TO * * @return string|null The server response, or null if pipelining is enabled */ @@ -331,20 +331,23 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport } $this->pipeline[] = [$command, $seq, $codes, $address]; + if ($pipeline && $this->pipelining) { - $response = null; - } else { - while ($this->pipeline) { - list($command, $seq, $codes, $address) = array_shift($this->pipeline); - $response = $this->getFullResponse($seq); - try { - $this->assertResponseCode($response, $codes); - } catch (Swift_TransportException $e) { - if ($this->pipeline && $address) { - $failures[] = $address; - } else { - $this->throwException($e); - } + return null; + } + + $response = null; + + while ($this->pipeline) { + list($command, $seq, $codes, $address) = array_shift($this->pipeline); + $response = $this->getFullResponse($seq); + try { + $this->assertResponseCode($response, $codes); + } catch (Swift_TransportException $e) { + if ($this->pipeline && $address) { + $failures[] = $address; + } else { + $this->throwException($e); } } } @@ -446,7 +449,7 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport } list($code) = sscanf($response, '%3d'); - $valid = (empty($wanted) || in_array($code, $wanted)); + $valid = (empty($wanted) || \in_array($code, $wanted)); if ($evt = $this->eventDispatcher->createResponseEvent($this, $response, $valid)) { @@ -493,9 +496,9 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport } if (0 != $sent) { - $sent += count($failedRecipients); + $sent += \count($failedRecipients); $this->doDataCommand($failedRecipients); - $sent -= count($failedRecipients); + $sent -= \count($failedRecipients); $this->streamMessage($message); } else { diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php index 51dc7f563..e7ccf6dba 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php @@ -56,16 +56,16 @@ class Swift_Transport_Esmtp_Auth_CramMd5Authenticator implements Swift_Transport */ private function getResponse($secret, $challenge) { - if (strlen($secret) > 64) { + if (\strlen($secret) > 64) { $secret = pack('H32', md5($secret)); } - if (strlen($secret) < 64) { - $secret = str_pad($secret, 64, chr(0)); + if (\strlen($secret) < 64) { + $secret = str_pad($secret, 64, \chr(0)); } - $k_ipad = substr($secret, 0, 64) ^ str_repeat(chr(0x36), 64); - $k_opad = substr($secret, 0, 64) ^ str_repeat(chr(0x5C), 64); + $k_ipad = substr($secret, 0, 64) ^ str_repeat(\chr(0x36), 64); + $k_opad = substr($secret, 0, 64) ^ str_repeat(\chr(0x5C), 64); $inner = pack('H32', md5($k_ipad.$challenge)); $digest = md5($k_opad.$inner); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php index 90081f8e6..21c070e34 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php @@ -37,11 +37,11 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es */ public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password) { - if (!function_exists('openssl_encrypt')) { + if (!\function_exists('openssl_encrypt')) { throw new LogicException('The OpenSSL extension must be enabled to use the NTLM authenticator.'); } - if (!function_exists('bcmul')) { + if (!\function_exists('bcmul')) { throw new LogicException('The BCMath functions must be enabled to use the NTLM authenticator.'); } @@ -51,8 +51,8 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es $response = base64_decode(substr(trim($this->sendMessage1($agent)), 4)); // extra parameters for our unit cases - $timestamp = func_num_args() > 3 ? func_get_arg(3) : $this->getCorrectTimestamp(bcmul(microtime(true), '1000')); - $client = func_num_args() > 4 ? func_get_arg(4) : random_bytes(8); + $timestamp = \func_num_args() > 3 ? func_get_arg(3) : $this->getCorrectTimestamp(bcmul(microtime(true), '1000')); + $client = \func_num_args() > 4 ? func_get_arg(4) : random_bytes(8); // Message 3 response $this->sendMessage3($response, $username, $password, $timestamp, $client, $agent); @@ -68,20 +68,20 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es protected function si2bin($si, $bits = 32) { $bin = null; - if ($si >= -pow(2, $bits - 1) && ($si <= pow(2, $bits - 1))) { + if ($si >= -2 ** ($bits - 1) && ($si <= 2 ** ($bits - 1))) { // positive or zero if ($si >= 0) { $bin = base_convert($si, 10, 2); // pad to $bits bit - $bin_length = strlen($bin); + $bin_length = \strlen($bin); if ($bin_length < $bits) { $bin = str_repeat('0', $bits - $bin_length).$bin; } } else { // negative - $si = -$si - pow(2, $bits); + $si = -$si - 2 ** $bits; $bin = base_convert($si, 10, 2); - $bin_length = strlen($bin); + $bin_length = \strlen($bin); if ($bin_length > $bits) { $bin = str_repeat('1', $bits - $bin_length).$bin; } @@ -147,7 +147,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es // remove terminatorByte cause it's always the same $block = substr($block, 0, -8); - $length = strlen($block); + $length = \strlen($block); $offset = 0; $data = []; while ($offset < $length) { @@ -157,7 +157,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es $offset += $blockLength * 2; } - if (3 == count($data)) { + if (3 == \count($data)) { $data[] = $data[2]; $data[2] = ''; } @@ -364,7 +364,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es $binary = $this->si2bin($time, 64); // create 64 bit binary string $timestamp = ''; for ($i = 0; $i < 8; ++$i) { - $timestamp .= chr(bindec(substr($binary, -(($i + 1) * 8), 8))); + $timestamp .= \chr(bindec(substr($binary, -(($i + 1) * 8), 8))); } return $timestamp; @@ -385,7 +385,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es { $lmPass = '00'; // by default 00 // if $password > 15 than we can't use this method - if (strlen($password) <= 15) { + if (\strlen($password) <= 15) { $ntlmHash = $this->md4Encrypt($password); $ntml2Hash = $this->md5Encrypt($ntlmHash, $this->convertTo16bit(strtoupper($username).$domain)); @@ -426,13 +426,13 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es protected function createDesKey($key) { $material = [bin2hex($key[0])]; - $len = strlen($key); + $len = \strlen($key); for ($i = 1; $i < $len; ++$i) { list($high, $low) = str_split(bin2hex($key[$i])); - $v = $this->castToByte(ord($key[$i - 1]) << (7 + 1 - $i) | $this->uRShift(hexdec(dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xf)), $i)); + $v = $this->castToByte(\ord($key[$i - 1]) << (7 + 1 - $i) | $this->uRShift(hexdec(dechex(hexdec($high) & 0xf).dechex(hexdec($low) & 0xf)), $i)); $material[] = str_pad(substr(dechex($v), -2), 2, '0', STR_PAD_LEFT); // cast to byte } - $material[] = str_pad(substr(dechex($this->castToByte(ord($key[6]) << 1)), -2), 2, '0'); + $material[] = str_pad(substr(dechex($this->castToByte(\ord($key[6]) << 1)), -2), 2, '0'); // odd parity foreach ($material as $k => $v) { @@ -465,7 +465,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es */ protected function createSecurityBuffer($value, $offset, $is16 = false) { - $length = strlen(bin2hex($value)); + $length = \strlen(bin2hex($value)); $length = $is16 ? $length / 2 : $length; $length = $this->createByte(str_pad(dechex($length), 2, '0', STR_PAD_LEFT), 2); @@ -563,7 +563,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es protected function md5Encrypt($key, $msg) { $blocksize = 64; - if (strlen($key) > $blocksize) { + if (\strlen($key) > $blocksize) { $key = pack('H*', md5($key)); } @@ -587,7 +587,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es { $input = $this->convertTo16bit($input); - return function_exists('hash') ? hex2bin(hash('md4', $input)) : mhash(MHASH_MD4, $input); + return \function_exists('hash') ? hex2bin(hash('md4', $input)) : mhash(MHASH_MD4, $input); } /** diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php index 1ff961cc3..41d0a50a8 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php @@ -31,7 +31,7 @@ class Swift_Transport_Esmtp_Auth_PlainAuthenticator implements Swift_Transport_E public function authenticate(Swift_Transport_SmtpAgent $agent, $username, $password) { try { - $message = base64_encode($username.chr(0).$username.chr(0).$password); + $message = base64_encode($username.\chr(0).$username.\chr(0).$password); $agent->executeCommand(sprintf("AUTH PLAIN %s\r\n", $message), [235]); return true; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php index 37334208a..dd559132b 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php @@ -171,7 +171,7 @@ class Swift_Transport_Esmtp_AuthHandler implements Swift_Transport_EsmtpHandler $count = 0; $errors = []; foreach ($this->getAuthenticatorsForAgent() as $authenticator) { - if (in_array(strtolower($authenticator->getAuthKeyword()), array_map('strtolower', $this->esmtpParams))) { + if (\in_array(strtolower($authenticator->getAuthKeyword()), array_map('strtolower', $this->esmtpParams))) { ++$count; try { if ($authenticator->authenticate($agent, $this->username, $this->password)) { diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php index cadfdc651..f692a6fe4 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php @@ -25,9 +25,8 @@ interface Swift_Transport_Esmtp_Authenticator /** * Try to authenticate the user with $username and $password. * - * @param Swift_Transport_SmtpAgent $agent - * @param string $username - * @param string $password + * @param string $username + * @param string $password * * @return bool true if authentication worked (returning false is deprecated, throw a Swift_TransportException instead) * diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php index d1f1c2cf7..bce0cdd42 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php @@ -235,7 +235,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo * Returns whether SMTP pipelining is enabled. * * @return bool|null a boolean if pipelining is explicitly enabled or disabled, - * or null if support is auto-detected. + * or null if support is auto-detected */ public function getPipelining() { @@ -284,7 +284,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo * @param int[] $codes * @param string[] $failures An array of failures by-reference * @param bool $pipeline Do not wait for response - * @param string $address The address, if command is RCPT TO. + * @param string $address the address, if command is RCPT TO * * @return string|null The server response, or null if pipelining is enabled */ @@ -309,10 +309,10 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo public function __call($method, $args) { foreach ($this->handlers as $handler) { - if (in_array(strtolower($method), + if (\in_array(strtolower($method), array_map('strtolower', (array) $handler->exposeMixinMethods()) )) { - $return = call_user_func_array([$handler, $method], $args); + $return = \call_user_func_array([$handler, $method], $args); // Allow fluid method calls if (null === $return && 'set' == substr($method, 0, 3)) { return $this; @@ -425,7 +425,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo private function setHandlerParams() { foreach ($this->handlers as $keyword => $handler) { - if (array_key_exists($keyword, $this->capabilities)) { + if (\array_key_exists($keyword, $this->capabilities)) { $handler->setKeywordParams($this->capabilities[$keyword]); } } @@ -436,7 +436,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo { $handlers = []; foreach ($this->handlers as $keyword => $handler) { - if (array_key_exists($keyword, $this->capabilities)) { + if (\array_key_exists($keyword, $this->capabilities)) { $handlers[] = $handler; } } diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php index 21bce4b60..1a4b4754f 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/FailoverTransport.php @@ -33,7 +33,7 @@ class Swift_Transport_FailoverTransport extends Swift_Transport_LoadBalancedTran */ public function ping() { - $maxTransports = count($this->transports); + $maxTransports = \count($this->transports); for ($i = 0; $i < $maxTransports && $transport = $this->getNextTransport(); ++$i) { if ($transport->ping()) { @@ -43,7 +43,7 @@ class Swift_Transport_FailoverTransport extends Swift_Transport_LoadBalancedTran } } - return count($this->transports) > 0; + return \count($this->transports) > 0; } /** @@ -58,7 +58,7 @@ class Swift_Transport_FailoverTransport extends Swift_Transport_LoadBalancedTran */ public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) { - $maxTransports = count($this->transports); + $maxTransports = \count($this->transports); $sent = 0; $this->lastUsedTransport = null; @@ -79,10 +79,8 @@ class Swift_Transport_FailoverTransport extends Swift_Transport_LoadBalancedTran } } - if (0 == count($this->transports)) { - throw new Swift_TransportException( - 'All Transports in FailoverTransport failed, or no Transports available' - ); + if (0 == \count($this->transports)) { + throw new Swift_TransportException('All Transports in FailoverTransport failed, or no Transports available'); } return $sent; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php index af97adf1f..50f1e5e40 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/IoBuffer.php @@ -25,8 +25,6 @@ interface Swift_Transport_IoBuffer extends Swift_InputByteStream, Swift_OutputBy * Perform any initialization needed, using the given $params. * * Parameters will vary depending upon the type of IoBuffer used. - * - * @param array $params */ public function initialize(array $params); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php index a12ce8d2d..0b5ba9d30 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php @@ -79,7 +79,7 @@ class Swift_Transport_LoadBalancedTransport implements Swift_Transport */ public function isStarted() { - return count($this->transports) > 0; + return \count($this->transports) > 0; } /** @@ -111,7 +111,7 @@ class Swift_Transport_LoadBalancedTransport implements Swift_Transport } } - return count($this->transports) > 0; + return \count($this->transports) > 0; } /** @@ -126,7 +126,7 @@ class Swift_Transport_LoadBalancedTransport implements Swift_Transport */ public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) { - $maxTransports = count($this->transports); + $maxTransports = \count($this->transports); $sent = 0; $this->lastUsedTransport = null; @@ -145,10 +145,8 @@ class Swift_Transport_LoadBalancedTransport implements Swift_Transport } } - if (0 == count($this->transports)) { - throw new Swift_TransportException( - 'All Transports in LoadBalancedTransport failed, or no Transports available' - ); + if (0 == \count($this->transports)) { + throw new Swift_TransportException('All Transports in LoadBalancedTransport failed, or no Transports available'); } return $sent; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php index 5934ca93b..7d910db5a 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/NullTransport.php @@ -80,9 +80,9 @@ class Swift_Transport_NullTransport implements Swift_Transport } $count = ( - count((array) $message->getTo()) - + count((array) $message->getCc()) - + count((array) $message->getBcc()) + \count((array) $message->getTo()) + + \count((array) $message->getCc()) + + \count((array) $message->getBcc()) ); return $count; diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php index 7f0476ada..72ddae845 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/SendmailTransport.php @@ -122,9 +122,9 @@ class Swift_Transport_SendmailTransport extends Swift_Transport_AbstractSmtpTran $buffer->setWriteTranslations(["\r\n" => "\n"]); } - $count = count((array) $message->getTo()) - + count((array) $message->getCc()) - + count((array) $message->getBcc()) + $count = \count((array) $message->getTo()) + + \count((array) $message->getCc()) + + \count((array) $message->getBcc()) ; $message->toByteStream($buffer); $buffer->flushBuffers(); diff --git a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php index 5f7b8ac9e..70782ada0 100644 --- a/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php +++ b/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php @@ -160,14 +160,10 @@ class Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableIn { if (isset($this->out) && !feof($this->out)) { $line = fgets($this->out); - if (0 == strlen($line)) { + if (0 == \strlen($line)) { $metas = stream_get_meta_data($this->out); if ($metas['timed_out']) { - throw new Swift_IoException( - 'Connection to '. - $this->getReadConnectionDescription(). - ' Timed Out' - ); + throw new Swift_IoException('Connection to '.$this->getReadConnectionDescription().' Timed Out'); } } @@ -192,14 +188,10 @@ class Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableIn { if (isset($this->out) && !feof($this->out)) { $ret = fread($this->out, $length); - if (0 == strlen($ret)) { + if (0 == \strlen($ret)) { $metas = stream_get_meta_data($this->out); if ($metas['timed_out']) { - throw new Swift_IoException( - 'Connection to '. - $this->getReadConnectionDescription(). - ' Timed Out' - ); + throw new Swift_IoException('Connection to '.$this->getReadConnectionDescription().' Timed Out'); } } @@ -224,7 +216,7 @@ class Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableIn protected function doCommit($bytes) { if (isset($this->in)) { - $bytesToWrite = strlen($bytes); + $bytesToWrite = \strlen($bytes); $totalBytesWritten = 0; while ($totalBytesWritten < $bytesToWrite) { @@ -299,9 +291,7 @@ class Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableIn $this->stream = proc_open($command, $descriptorSpec, $pipes); stream_set_blocking($pipes[2], 0); if ($err = stream_get_contents($pipes[2])) { - throw new Swift_TransportException( - 'Process could not be started ['.$err.']' - ); + throw new Swift_TransportException('Process could not be started ['.$err.']'); } $this->in = &$pipes[0]; $this->out = &$pipes[1]; diff --git a/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php b/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php index 3b940b7f1..c9e19d320 100644 --- a/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php +++ b/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php @@ -1,8 +1,8 @@ #!/usr/bin/php '{$mime_type}'"; @@ -156,7 +156,7 @@ function generateUpToDateMimeArray() $extension = strtolower(trim($node->glob['ddpattern'][0], '*.')); // skip none glob extensions and check if string length between 1 and 10 - if (false !== strpos($extension, '.') || strlen($extension) < 1 || strlen($extension) > 9) { + if (false !== strpos($extension, '.') || \strlen($extension) < 1 || \strlen($extension) > 9) { continue; } diff --git a/vendor/swiftmailer/swiftmailer/phpunit.xml.dist b/vendor/swiftmailer/swiftmailer/phpunit.xml.dist deleted file mode 100644 index 9ec0c49a3..000000000 --- a/vendor/swiftmailer/swiftmailer/phpunit.xml.dist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - tests/unit - - - tests/acceptance - - - tests/bug - - - tests/smoke - - - - - - - diff --git a/vendor/swiftmailer/swiftmailer/tests/IdenticalBinaryConstraint.php b/vendor/swiftmailer/swiftmailer/tests/IdenticalBinaryConstraint.php deleted file mode 100644 index 0a4a6da89..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/IdenticalBinaryConstraint.php +++ /dev/null @@ -1,62 +0,0 @@ -value = $value; - } - - /** - * Evaluates the constraint for parameter $other. Returns TRUE if the - * constraint is met, FALSE otherwise. - * - * @param mixed $other Value or object to evaluate. - * - * @return bool - */ - public function matches($other) - { - $aHex = $this->asHexString($this->value); - $bHex = $this->asHexString($other); - - return $aHex === $bHex; - } - - /** - * Returns a string representation of the constraint. - * - * @return string - */ - public function toString() - { - return 'identical binary'; - } - - /** - * Get the given string of bytes as a stirng of Hexadecimal sequences. - * - * @param string $binary - * - * @return string - */ - private function asHexString($binary) - { - $hex = ''; - - $bytes = unpack('H*', $binary); - - foreach ($bytes as &$byte) { - $byte = strtoupper($byte); - } - - return implode('', $bytes); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/StreamCollector.php b/vendor/swiftmailer/swiftmailer/tests/StreamCollector.php deleted file mode 100644 index 7f079d983..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/StreamCollector.php +++ /dev/null @@ -1,11 +0,0 @@ -content .= $arg; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/SwiftMailerSmokeTestCase.php b/vendor/swiftmailer/swiftmailer/tests/SwiftMailerSmokeTestCase.php deleted file mode 100644 index 13bd24033..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/SwiftMailerSmokeTestCase.php +++ /dev/null @@ -1,46 +0,0 @@ -markTestSkipped( - 'Smoke tests are skipped if tests/smoke.conf.php is not edited' - ); - } - } - - protected function getMailer() - { - switch (SWIFT_SMOKE_TRANSPORT_TYPE) { - case 'smtp': - $transport = Swift_DependencyContainer::getInstance()->lookup('transport.smtp') - ->setHost(SWIFT_SMOKE_SMTP_HOST) - ->setPort(SWIFT_SMOKE_SMTP_PORT) - ->setUsername(SWIFT_SMOKE_SMTP_USER) - ->setPassword(SWIFT_SMOKE_SMTP_PASS) - ->setEncryption(SWIFT_SMOKE_SMTP_ENCRYPTION) - ; - break; - case 'sendmail': - $transport = Swift_DependencyContainer::getInstance()->lookup('transport.sendmail') - ->setCommand(SWIFT_SMOKE_SENDMAIL_COMMAND) - ; - break; - case 'mail': - case 'nativemail': - $transport = Swift_DependencyContainer::getInstance()->lookup('transport.mail'); - break; - default: - throw new Exception('Undefined transport ['.SWIFT_SMOKE_TRANSPORT_TYPE.']'); - } - - return new Swift_Mailer($transport); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/SwiftMailerTestCase.php b/vendor/swiftmailer/swiftmailer/tests/SwiftMailerTestCase.php deleted file mode 100644 index fe2c62b42..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/SwiftMailerTestCase.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/vendor/swiftmailer/swiftmailer/tests/_samples/files/swiftmailer.png b/vendor/swiftmailer/swiftmailer/tests/_samples/files/swiftmailer.png deleted file mode 100644 index 1b95f619af1fcbed1fca382d22022bdf329849cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3194 zcmV-=42AQFP)MSx|GoLxC1$NK z_Ph69ufRtQ76+DFuvF-8orSRY^mzh{hyTC*`g`GJF2^N{QXxQY!g418;53Gy4`6Wt z@W4WCEiaf6;7tNLOGCi-2=LHCZ7mC!tMIWuL$7RVA;G=7=x|%8^OYGLShnYUDhm&{ zg*qRgG59-xrCOlVLap5bussX4wX{GtNp2L?&||kP)YeRa-p?TroQ0vc-dGelVxhJ` zbHgmj`XYe6V)0vOpab&4Cj>2rw?=>CC(n=L-$$^lSx;?E2D-=Qo8dr^dBcluc+ORJ zo@Ok)#uf8ieAG%L42Q#c`YOud`3-#p& zx0pwR}3v$0N&KqF{v0Ir|mG1_!JrIaAnQ_n_r40Af1%SNq$VGh?- zDXXWpP)~pJk68AdlR|>owIyz$&Kl?@%RbwIX}OKd*e}{@>J;|jNB^t|SqlG$KX_@< zYPOT{srCWpmc{fEdFtc$hkWQ00_xRYTk~Q-#%(ZN)nMakx2TCY4cs|+=~l+UpzgXH z3KFBCVsZn{{@|S|8)bT`V)?Z;Zx^N|a=FAncPT*Yk;goObw@Ek5$~cJb)e&uswQUhp?_8ZB}LDU1)1XVxzQBgVh!5bYS*aa$n|JikshH+4PM@px5US z5KI1hj^xpt1p^u_NV(oZoq@I4d3Q?gY1@Xf0y7?wX2swT7EcHglRVbe z0s_q_WwNWG>Pu4vf1~O-k3Mg0@!VhV^|zdz4O~YIj}5@ z)|!D$l=1lH%JrgXWP>a>qy`4 zfd_Xf*yB0msv=VnO421sgGW<)JvhBrJALv+<+Cq+cK6}C5v;E~_vYC~kG{Uo{Le>+ zz5eve?B>-s*bC2G&c>a(FWeJ{VvUPW=jQFDIEYEMIT|^L*`CApFW>5Gpxq`exeb89 zK7rhmuDQL!NoS)W{BchYPx)ZMZO}SZReVg^Oa`>3+8)*qpg=su`iAD=;tzrDdzX&m zBt-gYJVkUPuC3gN{#jlARs{76&#bZQS6)8f>I#dXe&yLW+0E5AlsiJm3G|b<*-N~2 zQ#XAApDW}JY&X_81Ta_V;cXaP170tBZ-i?d;8r~(n~HKdiE#iXUU^&Ld}NF6C2Whw z-vGGfa~qqI4Vd+ry8rqeEX!*GX zPzuPkInk36ZVgpFze_+8TWRTeWKV;P8V#8kOEY&5b$_oN=C zfVZ9!c1KeSWEKdT+UKXAXurGQxsz=>%?&57Zc?TJIUHR%WUjYKGjD6|O`mFWU-Qsy z8$ex&%YLW|W*0O|TXOeRszyS|bM{oy0VIWM2yYGh6Now-{;$MnFB9tv7p>Bn0mTPK z!QiJ~e83)pUOtEVUq&Z^zk2`=z%|g`FMi`kNt*|xpDPM&E!L90^pHD3t%<+)L}>x= zHZ-2OF^#M+sfjfAr7g+}fWNCK^DS7vtB@f&qSp+K@c*Z;;KpqHsmIns`02nB4 zKwSio^mHYm+UaW~&e@6U0#MmVdv+-Z>#CrJZMv%8!uDfOe*$nqU}t{`TMB zU-0PvdvY3n|LTu*WzdK7X$j|mWieEgSzQ4MV=|V}Au&KJv7|%P<1?LGi1~iu+Cz>4&0c?*B=<+n4#;eO3s47W{ zB(KnrY5~Xa!V72jAAhXU+^x4>?YbX+^mElu_Obwx(tOI-?@m=iD#6~&JN?i2qW>RG*IxzvC z%KL6Ag*@E5P1w+3EWTGe$UjqK^=XXgpk4UJ66dz_(44`X-J*wOdY zC3PE?sU85{Opeu46To)qgaW}McTAwBbX>sVJLeoLAdicbjaw0CU|8T4Yz>qR`*Zx{ z+j~*|8UM!5zy9YpMF>P?YXZdggn*yNM!9B0Ks$Q?rb>=BDOWvU=S|x+dKevHdv6+N zwxXyaOr8>5gMrK9JEM4tCpyjcS$XLuzi#aBtm>469-6Pme$)jpWxpG8LPf}kplnsm zF<8y|{FYhzd|-=GfF_<;r>D7h_Y#gj$N}i82*;<7K8QN|$63<%c^Ed4vvfnRa+O8k zt$hMJcR7Yox0kQ|+vLDli0e4wKui0mXP$0f{gmtdgjU3G+I6I(FJyO6e*FExA7i_h ze)i??Y}=IZgekTUlC}k~cMZTn$FZiU&cg{G2IFg>kt}O0x&1?~f!b4)+h{l!M*UB| zTCG3+$Ip%xItYL4#dzm&aXQ|L7~9OP>cyuT4WkKyD#A@x{zjTR4?7HbbltHp9Ks=4 zvJ^p}1>jph{m!3#)xI_7A$O?_sPhstId7(!_m4)vIEs7c(g0t@$jUKGD|Z1+@@7 z?vvLG$!qTxG$6#j9L))L;gN?9EglOFwWc~p0NO?IXhII!W;iU=sXd`Qp=6(c2<8Mc zA2&H^qfx*Vb46RbBv1<=b=i2o*xcbJ?VM(2P1$mL-?z1bLrp+Aq_e9ExCdEzKJv^6 z^VSqn!+K{6^+Z*FK%Q_g3*Ak@Du2_#q@MX~c7E%fEz~AnyTkNT_J$N#p3r9yCsXKQ z;jeeQ#bz`6&|I~@wUR+CY1~dqSs+S)Earl*U32337r@fWm`K g-$HCnw*Lz-0AR%yng8k!ga7~l07*qoM6N<$f>^s2o&W#< diff --git a/vendor/swiftmailer/swiftmailer/tests/_samples/files/textfile.zip b/vendor/swiftmailer/swiftmailer/tests/_samples/files/textfile.zip deleted file mode 100644 index 5a580ecbf81ff98445bc5c6d0fce7a9a301f0e39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 202 zcmWIWW@h1HU}9ikII%0tqR&rhgC39#!aNM33?-=*C25&Csd^<9C7~gl49w;G_PK*_ zXax(ySH`c5AsLy)3P4nlSX82rpQezg5L}*_R-)jW2-H=iP-db~oSUDWs!)testFile = sys_get_temp_dir().'/swift-test-file'.__CLASS__; - file_put_contents($this->testFile, 'abcdefghijklm'); - } - - protected function tearDown() - { - unlink($this->testFile); - } - - public function testFileDataCanBeRead() - { - $file = $this->createFileStream($this->testFile); - $str = ''; - while (false !== $bytes = $file->read(8192)) { - $str .= $bytes; - } - $this->assertEquals('abcdefghijklm', $str); - } - - public function testFileDataCanBeReadSequentially() - { - $file = $this->createFileStream($this->testFile); - $this->assertEquals('abcde', $file->read(5)); - $this->assertEquals('fghijklm', $file->read(8)); - $this->assertFalse($file->read(1)); - } - - public function testFilenameIsReturned() - { - $file = $this->createFileStream($this->testFile); - $this->assertEquals($this->testFile, $file->getPath()); - } - - public function testFileCanBeWrittenTo() - { - $file = $this->createFileStream($this->testFile, true); - $file->write('foobar'); - $this->assertEquals('foobar', $file->read(8192)); - } - - public function testReadingFromThenWritingToFile() - { - $file = $this->createFileStream($this->testFile, true); - $file->write('foobar'); - $this->assertEquals('foobar', $file->read(8192)); - $file->write('zipbutton'); - $this->assertEquals('zipbutton', $file->read(8192)); - } - - public function testWritingToFileWithCanonicalization() - { - $file = $this->createFileStream($this->testFile, true); - $file->addFilter($this->createFilter(["\r\n", "\r"], "\n"), 'allToLF'); - $file->write("foo\r\nbar\r"); - $file->write("\nzip\r\ntest\r"); - $file->flushBuffers(); - $this->assertEquals("foo\nbar\nzip\ntest\n", file_get_contents($this->testFile)); - } - - public function testWritingWithFulleMessageLengthOfAMultipleOf8192() - { - $file = $this->createFileStream($this->testFile, true); - $file->addFilter($this->createFilter(["\r\n", "\r"], "\n"), 'allToLF'); - $file->write(''); - $file->flushBuffers(); - $this->assertEquals('', file_get_contents($this->testFile)); - } - - public function testBindingOtherStreamsMirrorsWriteOperations() - { - $file = $this->createFileStream($this->testFile, true); - $is1 = $this->createMockInputStream(); - $is2 = $this->createMockInputStream(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->at(0)) - ->method('write') - ->with('x'); - $is2->expects($this->at(1)) - ->method('write') - ->with('y'); - - $file->bind($is1); - $file->bind($is2); - - $file->write('x'); - $file->write('y'); - } - - public function testBindingOtherStreamsMirrorsFlushOperations() - { - $file = $this->createFileStream( - $this->testFile, true - ); - $is1 = $this->createMockInputStream(); - $is2 = $this->createMockInputStream(); - - $is1->expects($this->once()) - ->method('flushBuffers'); - $is2->expects($this->once()) - ->method('flushBuffers'); - - $file->bind($is1); - $file->bind($is2); - - $file->flushBuffers(); - } - - public function testUnbindingStreamPreventsFurtherWrites() - { - $file = $this->createFileStream($this->testFile, true); - $is1 = $this->createMockInputStream(); - $is2 = $this->createMockInputStream(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->once()) - ->method('write') - ->with('x'); - - $file->bind($is1); - $file->bind($is2); - - $file->write('x'); - - $file->unbind($is2); - - $file->write('y'); - } - - private function createFilter($search, $replace) - { - return new Swift_StreamFilters_StringReplacementFilter($search, $replace); - } - - private function createMockInputStream() - { - return $this->getMockBuilder('Swift_InputByteStream')->getMock(); - } - - private function createFileStream($file, $writable = false) - { - return new Swift_ByteStream_FileByteStream($file, $writable); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php deleted file mode 100644 index fcc7ad4d0..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/CharacterReaderFactory/SimpleCharacterReaderFactoryAcceptanceTest.php +++ /dev/null @@ -1,179 +0,0 @@ -factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testCreatingUtf8Reader() - { - foreach (['utf8', 'utf-8', 'UTF-8', 'UTF8'] as $utf8) { - $reader = $this->factory->getReaderFor($utf8); - $this->assertInstanceOf($this->prefix.'Utf8Reader', $reader); - } - } - - public function testCreatingIso8859XReaders() - { - $charsets = []; - foreach (range(1, 16) as $number) { - foreach (['iso', 'iec'] as $body) { - $charsets[] = $body.'-8859-'.$number; - $charsets[] = $body.'8859-'.$number; - $charsets[] = strtoupper($body).'-8859-'.$number; - $charsets[] = strtoupper($body).'8859-'.$number; - } - } - - foreach ($charsets as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingWindows125XReaders() - { - $charsets = []; - foreach (range(0, 8) as $number) { - $charsets[] = 'windows-125'.$number; - $charsets[] = 'windows125'.$number; - $charsets[] = 'WINDOWS-125'.$number; - $charsets[] = 'WINDOWS125'.$number; - } - - foreach ($charsets as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingCodePageReaders() - { - $charsets = []; - foreach (range(0, 8) as $number) { - $charsets[] = 'cp-125'.$number; - $charsets[] = 'cp125'.$number; - $charsets[] = 'CP-125'.$number; - $charsets[] = 'CP125'.$number; - } - - foreach ([437, 737, 850, 855, 857, 858, 860, - 861, 863, 865, 866, 869, ] as $number) { - $charsets[] = 'cp-'.$number; - $charsets[] = 'cp'.$number; - $charsets[] = 'CP-'.$number; - $charsets[] = 'CP'.$number; - } - - foreach ($charsets as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingAnsiReader() - { - foreach (['ansi', 'ANSI'] as $ansi) { - $reader = $this->factory->getReaderFor($ansi); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingMacintoshReader() - { - foreach (['macintosh', 'MACINTOSH'] as $mac) { - $reader = $this->factory->getReaderFor($mac); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingKOIReaders() - { - $charsets = []; - foreach (['7', '8-r', '8-u', '8u', '8r'] as $end) { - $charsets[] = 'koi-'.$end; - $charsets[] = 'koi'.$end; - $charsets[] = 'KOI-'.$end; - $charsets[] = 'KOI'.$end; - } - - foreach ($charsets as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingIsciiReaders() - { - foreach (['iscii', 'ISCII', 'viscii', 'VISCII'] as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingMIKReader() - { - foreach (['mik', 'MIK'] as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingCorkReader() - { - foreach (['cork', 'CORK', 't1', 'T1'] as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(1, $reader->getInitialByteSize()); - } - } - - public function testCreatingUcs2Reader() - { - foreach (['ucs-2', 'UCS-2', 'ucs2', 'UCS2'] as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(2, $reader->getInitialByteSize()); - } - } - - public function testCreatingUtf16Reader() - { - foreach (['utf-16', 'UTF-16', 'utf16', 'UTF16'] as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(2, $reader->getInitialByteSize()); - } - } - - public function testCreatingUcs4Reader() - { - foreach (['ucs-4', 'UCS-4', 'ucs4', 'UCS4'] as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(4, $reader->getInitialByteSize()); - } - } - - public function testCreatingUtf32Reader() - { - foreach (['utf-32', 'UTF-32', 'utf32', 'UTF32'] as $charset) { - $reader = $this->factory->getReaderFor($charset); - $this->assertInstanceOf($this->prefix.'GenericFixedWidthReader', $reader); - $this->assertEquals(4, $reader->getInitialByteSize()); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php deleted file mode 100644 index 3c1b515b5..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/DependencyContainerAcceptanceTest.php +++ /dev/null @@ -1,22 +0,0 @@ -listItems() as $itemName) { - try { - $di->lookup($itemName); - } catch (Swift_DependencyException $e) { - $this->fail($e->getMessage()); - } - } - // previous loop would fail if there is an issue - $this->addToAssertionCount(1); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php deleted file mode 100644 index a172e9724..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php +++ /dev/null @@ -1,12 +0,0 @@ -samplesDir = realpath(__DIR__.'/../../../_samples/charsets'); - $this->encoder = new Swift_Encoder_Base64Encoder(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if ('.' == substr($encodingDir, 0, 1)) { - continue; - } - - $sampleDir = $this->samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if ('.' == substr($sampleFile, 0, 1)) { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - $encodedText = $this->encoder->encodeString($text); - - $this->assertEquals( - base64_decode($encodedText), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php deleted file mode 100644 index 5bbf067d4..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/QpEncoderAcceptanceTest.php +++ /dev/null @@ -1,54 +0,0 @@ -samplesDir = realpath(__DIR__.'/../../../_samples/charsets'); - $this->factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if ('.' == substr($encodingDir, 0, 1)) { - continue; - } - - $encoding = $encodingDir; - $charStream = new Swift_CharacterStream_ArrayCharacterStream( - $this->factory, $encoding); - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $sampleDir = $this->samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if ('.' == substr($sampleFile, 0, 1)) { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - $encodedText = $encoder->encodeString($text); - - foreach (explode("\r\n", $encodedText) as $line) { - $this->assertLessThanOrEqual(76, strlen($line)); - } - - $this->assertEquals( - quoted_printable_decode($encodedText), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php deleted file mode 100644 index 20c68d5de..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Encoder/Rfc2231EncoderAcceptanceTest.php +++ /dev/null @@ -1,50 +0,0 @@ -samplesDir = realpath(__DIR__.'/../../../_samples/charsets'); - $this->factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if ('.' == substr($encodingDir, 0, 1)) { - continue; - } - - $encoding = $encodingDir; - $charStream = new Swift_CharacterStream_ArrayCharacterStream( - $this->factory, $encoding); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - - $sampleDir = $this->samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if ('.' == substr($sampleFile, 0, 1)) { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - $encodedText = $encoder->encodeString($text); - - $this->assertEquals( - urldecode(implode('', explode("\r\n", $encodedText))), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php deleted file mode 100644 index c54986b2b..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/ArrayKeyCacheAcceptanceTest.php +++ /dev/null @@ -1,173 +0,0 @@ -cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - } - - public function testStringDataCanBeSetAndFetched() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->cache->getString($this->key1, 'foo')); - } - - public function testStringDataCanBeOverwritten() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key1, 'foo', 'whatever', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('whatever', $this->cache->getString($this->key1, 'foo')); - } - - public function testStringDataCanBeAppended() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key1, 'foo', 'ing', Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testing', $this->cache->getString($this->key1, 'foo')); - } - - public function testHasKeyReturnValue() - { - $this->assertFalse($this->cache->hasKey($this->key1, 'foo')); - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->cache->hasKey($this->key1, 'foo')); - } - - public function testNsKeyIsWellPartitioned() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key2, 'foo', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->cache->getString($this->key1, 'foo')); - $this->assertEquals('ing', $this->cache->getString($this->key2, 'foo')); - } - - public function testItemKeyIsWellPartitioned() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key1, 'bar', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->cache->getString($this->key1, 'foo')); - $this->assertEquals('ing', $this->cache->getString($this->key1, 'bar')); - } - - public function testByteStreamCanBeImported() - { - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->cache->importFromByteStream( - $this->key1, 'foo', $os, Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('abcdef', $this->cache->getString($this->key1, 'foo')); - } - - public function testByteStreamCanBeAppended() - { - $os1 = new Swift_ByteStream_ArrayByteStream(); - $os1->write('abcdef'); - - $os2 = new Swift_ByteStream_ArrayByteStream(); - $os2->write('xyzuvw'); - - $this->cache->importFromByteStream( - $this->key1, 'foo', $os1, Swift_KeyCache::MODE_APPEND - ); - $this->cache->importFromByteStream( - $this->key1, 'foo', $os2, Swift_KeyCache::MODE_APPEND - ); - - $this->assertEquals('abcdefxyzuvw', $this->cache->getString($this->key1, 'foo')); - } - - public function testByteStreamAndStringCanBeAppended() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_APPEND - ); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->cache->importFromByteStream( - $this->key1, 'foo', $os, Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testabcdef', $this->cache->getString($this->key1, 'foo')); - } - - public function testDataCanBeExportedToByteStream() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->cache->exportToByteStream($this->key1, 'foo', $is); - - $string = ''; - while (false !== $bytes = $is->read(8192)) { - $string .= $bytes; - } - - $this->assertEquals('test', $string); - } - - public function testKeyCanBeCleared() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->cache->hasKey($this->key1, 'foo')); - $this->cache->clearKey($this->key1, 'foo'); - $this->assertFalse($this->cache->hasKey($this->key1, 'foo')); - } - - public function testNsKeyCanBeCleared() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key1, 'bar', 'xyz', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->cache->hasKey($this->key1, 'foo')); - $this->assertTrue($this->cache->hasKey($this->key1, 'bar')); - $this->cache->clearAll($this->key1); - $this->assertFalse($this->cache->hasKey($this->key1, 'foo')); - $this->assertFalse($this->cache->hasKey($this->key1, 'bar')); - } - - public function testKeyCacheInputStream() - { - $is = $this->cache->getInputByteStream($this->key1, 'foo'); - $is->write('abc'); - $is->write('xyz'); - $this->assertEquals('abcxyz', $this->cache->getString($this->key1, 'foo')); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php deleted file mode 100644 index 976474235..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/KeyCache/DiskKeyCacheAcceptanceTest.php +++ /dev/null @@ -1,173 +0,0 @@ -key1 = uniqid(microtime(true), true); - $this->key2 = uniqid(microtime(true), true); - $this->cache = new Swift_KeyCache_DiskKeyCache(new Swift_KeyCache_SimpleKeyCacheInputStream(), sys_get_temp_dir()); - } - - public function testStringDataCanBeSetAndFetched() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->cache->getString($this->key1, 'foo')); - } - - public function testStringDataCanBeOverwritten() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key1, 'foo', 'whatever', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('whatever', $this->cache->getString($this->key1, 'foo')); - } - - public function testStringDataCanBeAppended() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key1, 'foo', 'ing', Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testing', $this->cache->getString($this->key1, 'foo')); - } - - public function testHasKeyReturnValue() - { - $this->assertFalse($this->cache->hasKey($this->key1, 'foo')); - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->cache->hasKey($this->key1, 'foo')); - } - - public function testNsKeyIsWellPartitioned() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key2, 'foo', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->cache->getString($this->key1, 'foo')); - $this->assertEquals('ing', $this->cache->getString($this->key2, 'foo')); - } - - public function testItemKeyIsWellPartitioned() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key1, 'bar', 'ing', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $this->cache->getString($this->key1, 'foo')); - $this->assertEquals('ing', $this->cache->getString($this->key1, 'bar')); - } - - public function testByteStreamCanBeImported() - { - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->cache->importFromByteStream( - $this->key1, 'foo', $os, Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('abcdef', $this->cache->getString($this->key1, 'foo')); - } - - public function testByteStreamCanBeAppended() - { - $os1 = new Swift_ByteStream_ArrayByteStream(); - $os1->write('abcdef'); - - $os2 = new Swift_ByteStream_ArrayByteStream(); - $os2->write('xyzuvw'); - - $this->cache->importFromByteStream( - $this->key1, 'foo', $os1, Swift_KeyCache::MODE_APPEND - ); - $this->cache->importFromByteStream( - $this->key1, 'foo', $os2, Swift_KeyCache::MODE_APPEND - ); - - $this->assertEquals('abcdefxyzuvw', $this->cache->getString($this->key1, 'foo')); - } - - public function testByteStreamAndStringCanBeAppended() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_APPEND - ); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write('abcdef'); - - $this->cache->importFromByteStream( - $this->key1, 'foo', $os, Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testabcdef', $this->cache->getString($this->key1, 'foo')); - } - - public function testDataCanBeExportedToByteStream() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->cache->exportToByteStream($this->key1, 'foo', $is); - - $string = ''; - while (false !== $bytes = $is->read(8192)) { - $string .= $bytes; - } - - $this->assertEquals('test', $string); - } - - public function testKeyCanBeCleared() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->cache->hasKey($this->key1, 'foo')); - $this->cache->clearKey($this->key1, 'foo'); - $this->assertFalse($this->cache->hasKey($this->key1, 'foo')); - } - - public function testNsKeyCanBeCleared() - { - $this->cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->cache->setString( - $this->key1, 'bar', 'xyz', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($this->cache->hasKey($this->key1, 'foo')); - $this->assertTrue($this->cache->hasKey($this->key1, 'bar')); - $this->cache->clearAll($this->key1); - $this->assertFalse($this->cache->hasKey($this->key1, 'foo')); - $this->assertFalse($this->cache->hasKey($this->key1, 'bar')); - } - - public function testKeyCacheInputStream() - { - $is = $this->cache->getInputByteStream($this->key1, 'foo'); - $is->write('abc'); - $is->write('xyz'); - $this->assertEquals('abcxyz', $this->cache->getString($this->key1, 'foo')); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php deleted file mode 100644 index 16adb23b0..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MessageAcceptanceTest.php +++ /dev/null @@ -1,55 +0,0 @@ -createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $message->addPart('foo', 'text/plain', 'iso-8859-1'); - $message->addPart('test foo', 'text/html', 'iso-8859-1'); - - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'test foo'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - protected function createMessage() - { - Swift_DependencyContainer::getInstance() - ->register('properties.charset')->asValue(null); - - return new Swift_Message(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php deleted file mode 100644 index 920faed9b..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/AttachmentAcceptanceTest.php +++ /dev/null @@ -1,126 +0,0 @@ -cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $this->contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $this->emailValidator = new EmailValidator(); - $this->idGenerator = new Swift_Mime_IdGenerator('example.com'); - $this->headers = new Swift_Mime_SimpleHeaderSet( - new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->emailValidator) - ); - } - - public function testDispositionIsSetInHeader() - { - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setDisposition('inline'); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: inline'."\r\n", - $attachment->toString() - ); - } - - public function testDispositionIsAttachmentByDefault() - { - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment'."\r\n", - $attachment->toString() - ); - } - - public function testFilenameIsSetInHeader() - { - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n", - $attachment->toString() - ); - } - - public function testSizeIsSetInHeader() - { - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setSize(12340); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; size=12340'."\r\n", - $attachment->toString() - ); - } - - public function testMultipleParametersInHeader() - { - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setSize(12340); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf; size=12340'."\r\n", - $attachment->toString() - ); - } - - public function testEndToEnd() - { - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setSize(12340); - $attachment->setBody('abcd'); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf; size=12340'."\r\n". - "\r\n". - base64_encode('abcd'), - $attachment->toString() - ); - } - - protected function createAttachment() - { - $entity = new Swift_Mime_Attachment( - $this->headers, - $this->contentEncoder, - $this->cache, - $this->idGenerator - ); - - return $entity; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php deleted file mode 100644 index a87b30ee6..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/Base64ContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,56 +0,0 @@ -samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); - $this->encoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if ('.' == substr($encodingDir, 0, 1)) { - continue; - } - - $sampleDir = $this->samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if ('.' == substr($sampleFile, 0, 1)) { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - base64_decode($encoded), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php deleted file mode 100644 index bf0a04eea..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/NativeQpContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,88 +0,0 @@ -samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); - $this->encoder = new Swift_Mime_ContentEncoder_NativeQpContentEncoder(); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if ('.' == substr($encodingDir, 0, 1)) { - continue; - } - - $sampleDir = $this->samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if ('.' == substr($sampleFile, 0, 1)) { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - $this->encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - quoted_printable_decode($encoded), - // CR and LF are converted to CRLF - preg_replace('~\r(?!\n)|(?createEncoderFromContainer(); - $this->assertSame('=C3=A4=C3=B6=C3=BC=C3=9F', $encoder->encodeString('äöüß')); - } - - /** - * @expectedException \RuntimeException - */ - public function testCharsetChangeNotImplemented() - { - $this->encoder->charsetChanged('utf-8'); - $this->encoder->charsetChanged('charset'); - $this->encoder->encodeString('foo'); - } - - public function testGetName() - { - $this->assertSame('quoted-printable', $this->encoder->getName()); - } - - private function createEncoderFromContainer() - { - return Swift_DependencyContainer::getInstance() - ->lookup('mime.nativeqpcontentencoder') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php deleted file mode 100644 index 544873a92..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/PlainContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,88 +0,0 @@ -samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); - $this->encoder = new Swift_Mime_ContentEncoder_PlainContentEncoder('8bit'); - } - - public function testEncodingAndDecodingSamplesString() - { - $sampleFp = opendir($this->samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if ('.' == substr($encodingDir, 0, 1)) { - continue; - } - - $sampleDir = $this->samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if ('.' == substr($sampleFile, 0, 1)) { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - $encodedText = $this->encoder->encodeString($text); - - $this->assertEquals( - $encodedText, $text, - '%s: Encoded string should be identical to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } - - public function testEncodingAndDecodingSamplesByteStream() - { - $sampleFp = opendir($this->samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if ('.' == substr($encodingDir, 0, 1)) { - continue; - } - - $sampleDir = $this->samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if ('.' == substr($sampleFile, 0, 1)) { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - - $this->encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - $encoded, $text, - '%s: Encoded string should be identical to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php deleted file mode 100644 index 26d1a9bd2..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/ContentEncoder/QpContentEncoderAcceptanceTest.php +++ /dev/null @@ -1,160 +0,0 @@ -samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); - $this->factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - } - - protected function tearDown() - { - Swift_Preferences::getInstance()->setQPDotEscape(false); - } - - public function testEncodingAndDecodingSamples() - { - $sampleFp = opendir($this->samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if ('.' == substr($encodingDir, 0, 1)) { - continue; - } - - $encoding = $encodingDir; - $charStream = new Swift_CharacterStream_NgCharacterStream( - $this->factory, $encoding); - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - - $sampleDir = $this->samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if ('.' == substr($sampleFile, 0, 1)) { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - $encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - quoted_printable_decode($encoded), $text, - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } - - public function testEncodingAndDecodingSamplesFromDiConfiguredInstance() - { - $sampleFp = opendir($this->samplesDir); - while (false !== $encodingDir = readdir($sampleFp)) { - if ('.' == substr($encodingDir, 0, 1)) { - continue; - } - - $encoding = $encodingDir; - $encoder = $this->createEncoderFromContainer(); - - $sampleDir = $this->samplesDir.'/'.$encodingDir; - - if (is_dir($sampleDir)) { - $fileFp = opendir($sampleDir); - while (false !== $sampleFile = readdir($fileFp)) { - if ('.' == substr($sampleFile, 0, 1)) { - continue; - } - - $text = file_get_contents($sampleDir.'/'.$sampleFile); - - $os = new Swift_ByteStream_ArrayByteStream(); - $os->write($text); - - $is = new Swift_ByteStream_ArrayByteStream(); - $encoder->encodeByteStream($os, $is); - - $encoded = ''; - while (false !== $bytes = $is->read(8192)) { - $encoded .= $bytes; - } - - $this->assertEquals( - str_replace("\r\n", "\n", quoted_printable_decode($encoded)), str_replace("\r\n", "\n", $text), - '%s: Encoded string should decode back to original string for sample '. - $sampleDir.'/'.$sampleFile - ); - } - closedir($fileFp); - } - } - closedir($sampleFp); - } - - public function testEncodingLFTextWithDiConfiguredInstance() - { - $encoder = $this->createEncoderFromContainer(); - $this->assertEquals("a\r\nb\r\nc", $encoder->encodeString("a\nb\nc")); - } - - public function testEncodingCRTextWithDiConfiguredInstance() - { - $encoder = $this->createEncoderFromContainer(); - $this->assertEquals("a\r\nb\r\nc", $encoder->encodeString("a\rb\rc")); - } - - public function testEncodingLFCRTextWithDiConfiguredInstance() - { - $encoder = $this->createEncoderFromContainer(); - $this->assertEquals("a\r\n\r\nb\r\n\r\nc", $encoder->encodeString("a\n\rb\n\rc")); - } - - public function testEncodingCRLFTextWithDiConfiguredInstance() - { - $encoder = $this->createEncoderFromContainer(); - $this->assertEquals("a\r\nb\r\nc", $encoder->encodeString("a\r\nb\r\nc")); - } - - public function testEncodingDotStuffingWithDiConfiguredInstance() - { - // Enable DotEscaping - Swift_Preferences::getInstance()->setQPDotEscape(true); - $encoder = $this->createEncoderFromContainer(); - $this->assertEquals("a=2E\r\n=2E\r\n=2Eb\r\nc", $encoder->encodeString("a.\r\n.\r\n.b\r\nc")); - // Return to default - Swift_Preferences::getInstance()->setQPDotEscape(false); - $encoder = $this->createEncoderFromContainer(); - $this->assertEquals("a.\r\n.\r\n.b\r\nc", $encoder->encodeString("a.\r\n.\r\n.b\r\nc")); - } - - public function testDotStuffingEncodingAndDecodingSamplesFromDiConfiguredInstance() - { - // Enable DotEscaping - Swift_Preferences::getInstance()->setQPDotEscape(true); - $this->testEncodingAndDecodingSamplesFromDiConfiguredInstance(); - } - - private function createEncoderFromContainer() - { - return Swift_DependencyContainer::getInstance() - ->lookup('mime.qpcontentencoder') - ; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php deleted file mode 100644 index 5603a67d7..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/EmbeddedFileAcceptanceTest.php +++ /dev/null @@ -1,139 +0,0 @@ -cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $this->contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $this->emailValidator = new EmailValidator(); - $this->idGenerator = new Swift_Mime_IdGenerator('example.com'); - $this->headers = new Swift_Mime_SimpleHeaderSet( - new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->emailValidator) - ); - } - - public function testContentIdIsSetInHeader() - { - $file = $this->createEmbeddedFile(); - $file->setContentType('application/pdf'); - $file->setId('foo@bar'); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: '."\r\n". - 'Content-Disposition: inline'."\r\n", - $file->toString() - ); - } - - public function testDispositionIsSetInHeader() - { - $file = $this->createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setDisposition('attachment'); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: attachment'."\r\n", - $file->toString() - ); - } - - public function testFilenameIsSetInHeader() - { - $file = $this->createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setFilename('foo.pdf'); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: inline; filename=foo.pdf'."\r\n", - $file->toString() - ); - } - - public function testSizeIsSetInHeader() - { - $file = $this->createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setSize(12340); - $this->assertEquals( - 'Content-Type: application/pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: inline; size=12340'."\r\n", - $file->toString() - ); - } - - public function testMultipleParametersInHeader() - { - $file = $this->createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setFilename('foo.pdf'); - $file->setSize(12340); - - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: inline; filename=foo.pdf; size=12340'."\r\n", - $file->toString() - ); - } - - public function testEndToEnd() - { - $file = $this->createEmbeddedFile(); - $id = $file->getId(); - $file->setContentType('application/pdf'); - $file->setFilename('foo.pdf'); - $file->setSize(12340); - $file->setBody('abcd'); - $this->assertEquals( - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$id.'>'."\r\n". - 'Content-Disposition: inline; filename=foo.pdf; size=12340'."\r\n". - "\r\n". - base64_encode('abcd'), - $file->toString() - ); - } - - protected function createEmbeddedFile() - { - $entity = new Swift_Mime_EmbeddedFile( - $this->headers, - $this->contentEncoder, - $this->cache, - $this->idGenerator - ); - - return $entity; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php deleted file mode 100644 index 13795135e..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php +++ /dev/null @@ -1,32 +0,0 @@ -encoder = new Swift_Mime_HeaderEncoder_Base64HeaderEncoder(); - } - - public function testEncodingJIS() - { - if (function_exists('mb_convert_encoding')) { - // base64_encode and split cannot handle long JIS text to fold - $subject = '長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い件名'; - - $encodedWrapperLength = strlen('=?iso-2022-jp?'.$this->encoder->getName().'??='); - - $old = mb_internal_encoding(); - mb_internal_encoding('utf-8'); - $newstring = mb_encode_mimeheader($subject, 'iso-2022-jp', 'B', "\r\n"); - mb_internal_encoding($old); - - $encoded = $this->encoder->encodeString($subject, 0, 75 - $encodedWrapperLength, 'iso-2022-jp'); - $this->assertEquals( - $encoded, $newstring, - 'Encoded string should decode back to original string for sample ' - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php deleted file mode 100644 index 5a12daad7..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/MimePartAcceptanceTest.php +++ /dev/null @@ -1,130 +0,0 @@ -cache = new Swift_KeyCache_ArrayKeyCache( - new Swift_KeyCache_SimpleKeyCacheInputStream() - ); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $this->contentEncoder = new Swift_Mime_ContentEncoder_QpContentEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'), - new Swift_StreamFilters_ByteArrayReplacementFilter( - [[0x0D, 0x0A], [0x0D], [0x0A]], - [[0x0A], [0x0A], [0x0D, 0x0A]] - ) - ); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder( - new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') - ); - $this->emailValidator = new EmailValidator(); - $this->idGenerator = new Swift_Mime_IdGenerator('example.com'); - $this->headers = new Swift_Mime_SimpleHeaderSet( - new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->emailValidator) - ); - } - - public function testCharsetIsSetInHeader() - { - $part = $this->createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('utf-8'); - $part->setBody('foobar'); - $this->assertEquals( - 'Content-Type: text/plain; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foobar', - $part->toString() - ); - } - - public function testFormatIsSetInHeaders() - { - $part = $this->createMimePart(); - $part->setContentType('text/plain'); - $part->setFormat('flowed'); - $part->setBody('> foobar'); - $this->assertEquals( - 'Content-Type: text/plain; format=flowed'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - '> foobar', - $part->toString() - ); - } - - public function testDelSpIsSetInHeaders() - { - $part = $this->createMimePart(); - $part->setContentType('text/plain'); - $part->setDelSp(true); - $part->setBody('foobar'); - $this->assertEquals( - 'Content-Type: text/plain; delsp=yes'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foobar', - $part->toString() - ); - } - - public function testAll3ParamsInHeaders() - { - $part = $this->createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('utf-8'); - $part->setFormat('fixed'); - $part->setDelSp(true); - $part->setBody('foobar'); - $this->assertEquals( - 'Content-Type: text/plain; charset=utf-8; format=fixed; delsp=yes'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foobar', - $part->toString() - ); - } - - public function testBodyIsCanonicalized() - { - $part = $this->createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('utf-8'); - $part->setBody("foobar\r\rtest\ning\r"); - $this->assertEquals( - 'Content-Type: text/plain; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - "foobar\r\n". - "\r\n". - "test\r\n". - "ing\r\n", - $part->toString() - ); - } - - protected function createMimePart() - { - $entity = new Swift_Mime_MimePart( - $this->headers, - $this->contentEncoder, - $this->cache, - $this->idGenerator - ); - - return $entity; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php deleted file mode 100644 index 1d981e784..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Mime/SimpleMessageAcceptanceTest.php +++ /dev/null @@ -1,1250 +0,0 @@ -setCharset(null); //TODO: Test with the charset defined - } - - public function testBasicHeaders() - { - /* -- RFC 2822, 3.6. - */ - - $message = $this->createMessage(); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString(), - '%s: Only required headers, and non-empty headers should be displayed' - ); - } - - public function testSubjectIsDisplayedIfSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testDateCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $id = $message->getId(); - $date = new DateTimeImmutable(); - $message->setDate($date); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMessageIdCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setId('foo@bar'); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: '."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testContentTypeCanBeChanged() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setContentType('text/html'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/html'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testCharsetCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setContentType('text/html'); - $message->setCharset('iso-8859-1'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testFormatCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFormat('flowed'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain; format=flowed'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testEncoderCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setContentType('text/html'); - $message->setEncoder( - new Swift_Mime_ContentEncoder_PlainContentEncoder('7bit') - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/html'."\r\n". - 'Content-Transfer-Encoding: 7bit'."\r\n", - $message->toString() - ); - } - - public function testFromAddressCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom('chris.corbyn@swiftmailer.org'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: chris.corbyn@swiftmailer.org'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testFromAddressCanBeSetWithName() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(['chris.corbyn@swiftmailer.org' => 'Chris Corbyn']); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleFromAddressesCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org', - ]); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn , mark@swiftmailer.org'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testReturnPathAddressCanBeSet() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testEmptyReturnPathHeaderCanBeUsed() - { - $message = $this->createMessage(); - $message->setReturnPath(''); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: <>'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testSenderCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setSender('chris.corbyn@swiftmailer.org'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Sender: chris.corbyn@swiftmailer.org'."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testSenderCanBeSetWithName() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setSender(['chris.corbyn@swiftmailer.org' => 'Chris']); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Sender: Chris '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testReplyToCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(['chris.corbyn@swiftmailer.org' => 'Chris']); - $message->setReplyTo(['chris@w3style.co.uk' => 'Myself']); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris '."\r\n". - 'Reply-To: Myself '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleReplyAddressCanBeUsed() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(['chris.corbyn@swiftmailer.org' => 'Chris']); - $message->setReplyTo([ - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - ]); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris '."\r\n". - 'Reply-To: Myself , Me '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testToAddressCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(['chris.corbyn@swiftmailer.org' => 'Chris']); - $message->setReplyTo([ - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - ]); - $message->setTo('mark@swiftmailer.org'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris '."\r\n". - 'Reply-To: Myself , Me '."\r\n". - 'To: mark@swiftmailer.org'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleToAddressesCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(['chris.corbyn@swiftmailer.org' => 'Chris']); - $message->setReplyTo([ - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - ]); - $message->setTo([ - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - ]); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris '."\r\n". - 'Reply-To: Myself , Me '."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testCcAddressCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(['chris.corbyn@swiftmailer.org' => 'Chris']); - $message->setReplyTo([ - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - ]); - $message->setTo([ - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - ]); - $message->setCc('john@some-site.com'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris '."\r\n". - 'Reply-To: Myself , Me '."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn '."\r\n". - 'Cc: john@some-site.com'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleCcAddressesCanBeSet() - { - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(['chris.corbyn@swiftmailer.org' => 'Chris']); - $message->setReplyTo([ - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - ]); - $message->setTo([ - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - ]); - $message->setCc([ - 'john@some-site.com' => 'John West', - 'fred@another-site.co.uk' => 'Big Fred', - ]); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris '."\r\n". - 'Reply-To: Myself , Me '."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn '."\r\n". - 'Cc: John West , Big Fred '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testBccAddressCanBeSet() - { - //Obviously Transports need to setBcc(array()) and send to each Bcc recipient - // separately in accordance with RFC 2822/2821 - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(['chris.corbyn@swiftmailer.org' => 'Chris']); - $message->setReplyTo([ - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - ]); - $message->setTo([ - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - ]); - $message->setCc([ - 'john@some-site.com' => 'John West', - 'fred@another-site.co.uk' => 'Big Fred', - ]); - $message->setBcc('x@alphabet.tld'); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris '."\r\n". - 'Reply-To: Myself , Me '."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn '."\r\n". - 'Cc: John West , Big Fred '."\r\n". - 'Bcc: x@alphabet.tld'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testMultipleBccAddressesCanBeSet() - { - //Obviously Transports need to setBcc(array()) and send to each Bcc recipient - // separately in accordance with RFC 2822/2821 - $message = $this->createMessage(); - $message->setSubject('just a test subject'); - $message->setFrom(['chris.corbyn@swiftmailer.org' => 'Chris']); - $message->setReplyTo([ - 'chris@w3style.co.uk' => 'Myself', - 'my.other@address.com' => 'Me', - ]); - $message->setTo([ - 'mark@swiftmailer.org', 'chris@swiftmailer.org' => 'Chris Corbyn', - ]); - $message->setCc([ - 'john@some-site.com' => 'John West', - 'fred@another-site.co.uk' => 'Big Fred', - ]); - $message->setBcc(['x@alphabet.tld', 'a@alphabet.tld' => 'A']); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris '."\r\n". - 'Reply-To: Myself , Me '."\r\n". - 'To: mark@swiftmailer.org, Chris Corbyn '."\r\n". - 'Cc: John West , Big Fred '."\r\n". - 'Bcc: x@alphabet.tld, A '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString() - ); - } - - public function testStringBodyIsAppended() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - $message->setBody( - 'just a test body'."\r\n". - 'with a new line' - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'just a test body'."\r\n". - 'with a new line', - $message->toString() - ); - } - - public function testStringBodyIsEncoded() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - $message->setBody( - 'Just s'.pack('C*', 0xC2, 0x01, 0x01).'me multi-'."\r\n". - 'line message!' - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'Just s=C2=01=01me multi-'."\r\n". - 'line message!', - $message->toString() - ); - } - - public function testChildrenCanBeAttached() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $part1 = $this->createMimePart(); - $part1->setContentType('text/plain'); - $part1->setCharset('iso-8859-1'); - $part1->setBody('foo'); - - $message->attach($part1); - - $part2 = $this->createMimePart(); - $part2->setContentType('text/html'); - $part2->setCharset('iso-8859-1'); - $part2->setBody('test foo'); - - $message->attach($part2); - - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'test foo'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testAttachmentsBeingAttached() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - - $id = $message->getId(); - $date = preg_quote($message->getDate()->format('r'), '~'); - $boundary = $message->getBoundary(); - - $part = $this->createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo'); - - $message->attach($part); - - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $this->assertRegExp( - '~^'. - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } - - public function testAttachmentsAndEmbeddedFilesBeingAttached() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - - $id = $message->getId(); - $date = preg_quote($message->getDate()->format('r'), '~'); - $boundary = $message->getBoundary(); - - $part = $this->createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo'); - - $message->attach($part); - - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $file = $this->createEmbeddedFile(); - $file->setContentType('image/jpeg'); - $file->setFilename('myimage.jpg'); - $file->setBody(''); - - $message->attach($file); - - $cid = $file->getId(); - - $this->assertRegExp( - '~^'. - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\2'."\r\n". - 'Content-Type: image/jpeg; name=myimage.jpg'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$cid.'>'."\r\n". - 'Content-Disposition: inline; filename=myimage.jpg'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--\\2--'."\r\n". - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } - - public function testComplexEmbeddingOfContent() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - - $id = $message->getId(); - $date = preg_quote($message->getDate()->format('r'), '~'); - $boundary = $message->getBoundary(); - - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $file = $this->createEmbeddedFile(); - $file->setContentType('image/jpeg'); - $file->setFilename('myimage.jpg'); - $file->setBody(''); - - $part = $this->createMimePart(); - $part->setContentType('text/html'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo '); - - $message->attach($part); - - $cid = $file->getId(); - - $this->assertRegExp( - '~^'. - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo './/=3D is just = in QP - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: image/jpeg; name=myimage.jpg'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$cid.'>'."\r\n". - 'Content-Disposition: inline; filename=myimage.jpg'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } - - public function testAttachingAndDetachingContent() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - - $id = $message->getId(); - $date = preg_quote($message->getDate()->format('r'), '~'); - $boundary = $message->getBoundary(); - - $part = $this->createMimePart(); - $part->setContentType('text/plain'); - $part->setCharset('iso-8859-1'); - $part->setBody('foo'); - - $message->attach($part); - - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $file = $this->createEmbeddedFile(); - $file->setContentType('image/jpeg'); - $file->setFilename('myimage.jpg'); - $file->setBody(''); - - $message->attach($file); - - $cid = $file->getId(); - - $message->detach($attachment); - - $this->assertRegExp( - '~^'. - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: image/jpeg; name=myimage.jpg'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$cid.'>'."\r\n". - 'Content-Disposition: inline; filename=myimage.jpg'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString(), - '%s: Attachment should have been detached' - ); - } - - public function testBoundaryDoesNotAppearAfterAllPartsAreDetached() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $part1 = $this->createMimePart(); - $part1->setContentType('text/plain'); - $part1->setCharset('iso-8859-1'); - $part1->setBody('foo'); - - $message->attach($part1); - - $part2 = $this->createMimePart(); - $part2->setContentType('text/html'); - $part2->setCharset('iso-8859-1'); - $part2->setBody('test foo'); - - $message->attach($part2); - - $message->detach($part1); - $message->detach($part2); - - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n", - $message->toString(), - '%s: Message should be restored to orignal state after parts are detached' - ); - } - - public function testCharsetFormatOrDelSpAreNotShownWhenBoundaryIsSet() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - $message->setCharset('utf-8'); - $message->setFormat('flowed'); - $message->setDelSp(true); - - $id = $message->getId(); - $date = $message->getDate(); - $boundary = $message->getBoundary(); - - $part1 = $this->createMimePart(); - $part1->setContentType('text/plain'); - $part1->setCharset('iso-8859-1'); - $part1->setBody('foo'); - - $message->attach($part1); - - $part2 = $this->createMimePart(); - $part2->setContentType('text/html'); - $part2->setCharset('iso-8859-1'); - $part2->setBody('test foo'); - - $message->attach($part2); - - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'test foo'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testBodyCanBeSetWithAttachments() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - $message->setContentType('text/html'); - $message->setCharset('iso-8859-1'); - $message->setBody('foo'); - - $id = $message->getId(); - $date = $message->getDate()->format('r'); - $boundary = $message->getBoundary(); - - $attachment = $this->createAttachment(); - $attachment->setContentType('application/pdf'); - $attachment->setFilename('foo.pdf'); - $attachment->setBody(''); - - $message->attach($attachment); - - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=iso-8859-1'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: application/pdf; name=foo.pdf'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=foo.pdf'."\r\n". - "\r\n". - base64_encode(''). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testHtmlPartAlwaysAppearsLast() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - - $id = $message->getId(); - $date = $message->getDate()->format('r'); - $boundary = $message->getBoundary(); - - $part1 = $this->createMimePart(); - $part1->setContentType('text/html'); - $part1->setBody('foo'); - - $part2 = $this->createMimePart(); - $part2->setContentType('text/plain'); - $part2->setBody('bar'); - - $message->attach($part1); - $message->attach($part2); - - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'bar'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testBodyBecomesPartIfOtherPartsAttached() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - $message->setContentType('text/html'); - $message->setBody('foo'); - - $id = $message->getId(); - $date = $message->getDate()->format('r'); - $boundary = $message->getBoundary(); - - $part2 = $this->createMimePart(); - $part2->setContentType('text/plain'); - $part2->setBody('bar'); - - $message->attach($part2); - - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'bar'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'foo'. - "\r\n\r\n". - '--'.$boundary.'--'."\r\n", - $message->toString() - ); - } - - public function testBodyIsCanonicalized() - { - $message = $this->createMessage(); - $message->setReturnPath('chris@w3style.co.uk'); - $message->setSubject('just a test subject'); - $message->setFrom([ - 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn', ]); - $message->setBody( - 'just a test body'."\n". - 'with a new line' - ); - $id = $message->getId(); - $date = $message->getDate(); - $this->assertEquals( - 'Return-Path: '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date->format('r')."\r\n". - 'Subject: just a test subject'."\r\n". - 'From: Chris Corbyn '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: text/plain'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'just a test body'."\r\n". - 'with a new line', - $message->toString() - ); - } - - protected function createMessage() - { - return new Swift_Message(); - } - - protected function createMimePart() - { - return new Swift_MimePart(); - } - - protected function createAttachment() - { - return new Swift_Attachment(); - } - - protected function createEmbeddedFile() - { - return new Swift_EmbeddedFile(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php deleted file mode 100644 index 581afc7db..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php +++ /dev/null @@ -1,15 +0,0 @@ -register('properties.charset')->asValue(null); - - return new Swift_MimePart(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php deleted file mode 100644 index 9bc09f88a..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/AbstractStreamBufferAcceptanceTest.php +++ /dev/null @@ -1,131 +0,0 @@ -markTestSkipped( - 'Will fail on travis-ci if not skipped due to travis blocking '. - 'socket mailing tcp connections.' - ); - } - - $this->buffer = new Swift_Transport_StreamBuffer( - $this->getMockBuilder('Swift_ReplacementFilterFactory')->getMock() - ); - } - - public function testReadLine() - { - $this->initializeBuffer(); - - $line = $this->buffer->readLine(0); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - $seq = $this->buffer->write("QUIT\r\n"); - $this->assertTrue((bool) $seq); - $line = $this->buffer->readLine($seq); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - $this->buffer->terminate(); - } - - public function testWrite() - { - $this->initializeBuffer(); - - $line = $this->buffer->readLine(0); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - - $seq = $this->buffer->write("HELO foo\r\n"); - $this->assertTrue((bool) $seq); - $line = $this->buffer->readLine($seq); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - - $seq = $this->buffer->write("QUIT\r\n"); - $this->assertTrue((bool) $seq); - $line = $this->buffer->readLine($seq); - $this->assertRegExp('/^[0-9]{3}.*?\r\n$/D', $line); - $this->buffer->terminate(); - } - - public function testBindingOtherStreamsMirrorsWriteOperations() - { - $this->initializeBuffer(); - - $is1 = $this->createMockInputStream(); - $is2 = $this->createMockInputStream(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->at(0)) - ->method('write') - ->with('x'); - $is2->expects($this->at(1)) - ->method('write') - ->with('y'); - - $this->buffer->bind($is1); - $this->buffer->bind($is2); - - $this->buffer->write('x'); - $this->buffer->write('y'); - } - - public function testBindingOtherStreamsMirrorsFlushOperations() - { - $this->initializeBuffer(); - - $is1 = $this->createMockInputStream(); - $is2 = $this->createMockInputStream(); - - $is1->expects($this->once()) - ->method('flushBuffers'); - $is2->expects($this->once()) - ->method('flushBuffers'); - - $this->buffer->bind($is1); - $this->buffer->bind($is2); - - $this->buffer->flushBuffers(); - } - - public function testUnbindingStreamPreventsFurtherWrites() - { - $this->initializeBuffer(); - - $is1 = $this->createMockInputStream(); - $is2 = $this->createMockInputStream(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->once()) - ->method('write') - ->with('x'); - - $this->buffer->bind($is1); - $this->buffer->bind($is2); - - $this->buffer->write('x'); - - $this->buffer->unbind($is2); - - $this->buffer->write('y'); - } - - private function createMockInputStream() - { - return $this->getMockBuilder('Swift_InputByteStream')->getMock(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php deleted file mode 100644 index 739a7ece4..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php +++ /dev/null @@ -1,33 +0,0 @@ -markTestSkipped( - 'Cannot run test without an SMTP host to connect to (define '. - 'SWIFT_SMTP_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - parent::setUp(); - } - - protected function initializeBuffer() - { - $parts = explode(':', SWIFT_SMTP_HOST); - $host = $parts[0]; - $port = $parts[1] ?? 25; - - $this->buffer->initialize([ - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'tcp', - 'blocking' => 1, - 'timeout' => 15, - ]); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php deleted file mode 100644 index 34ef3cbe4..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php +++ /dev/null @@ -1,26 +0,0 @@ -markTestSkipped( - 'Cannot run test without a path to sendmail (define '. - 'SWIFT_SENDMAIL_PATH in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - parent::setUp(); - } - - protected function initializeBuffer() - { - $this->buffer->initialize([ - 'type' => Swift_Transport_IoBuffer::TYPE_PROCESS, - 'command' => SWIFT_SENDMAIL_PATH.' -bs', - ]); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php deleted file mode 100644 index 67073f895..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SocketTimeoutTest.php +++ /dev/null @@ -1,65 +0,0 @@ -markTestSkipped( - 'Cannot run test without an SMTP host to connect to (define '. - 'SWIFT_SMTP_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - $serverStarted = false; - for ($i = 0; $i < 5; ++$i) { - $this->randomHighPort = random_int(50000, 65000); - $this->server = stream_socket_server('tcp://127.0.0.1:'.$this->randomHighPort); - if ($this->server) { - $serverStarted = true; - } - } - - $this->buffer = new Swift_Transport_StreamBuffer( - $this->getMockBuilder('Swift_ReplacementFilterFactory')->getMock() - ); - } - - protected function initializeBuffer() - { - $host = '127.0.0.1'; - $port = $this->randomHighPort; - - $this->buffer->initialize([ - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'tcp', - 'blocking' => 1, - 'timeout' => 1, - ]); - } - - public function testTimeoutException() - { - $this->initializeBuffer(); - $e = null; - try { - $line = $this->buffer->readLine(0); - } catch (Exception $e) { - } - $this->assertInstanceOf('Swift_IoException', $e, 'IO Exception Not Thrown On Connection Timeout'); - $this->assertRegExp('/Connection to .* Timed Out/', $e->getMessage()); - } - - protected function tearDown() - { - if ($this->server) { - stream_socket_shutdown($this->server, STREAM_SHUT_RDWR); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php deleted file mode 100644 index e3bee2c8c..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/SslSocketAcceptanceTest.php +++ /dev/null @@ -1,40 +0,0 @@ -markTestSkipped( - 'SSL is not configured for your system. It is not possible to run this test' - ); - } - if (!defined('SWIFT_SSL_HOST')) { - $this->markTestSkipped( - 'Cannot run test without an SSL enabled SMTP host to connect to (define '. - 'SWIFT_SSL_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - - parent::setUp(); - } - - protected function initializeBuffer() - { - $parts = explode(':', SWIFT_SSL_HOST); - $host = $parts[0]; - $port = $parts[1] ?? 25; - - $this->buffer->initialize([ - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'ssl', - 'blocking' => 1, - 'timeout' => 15, - ]); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php b/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php deleted file mode 100644 index a5092a249..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/TlsSocketAcceptanceTest.php +++ /dev/null @@ -1,39 +0,0 @@ -markTestSkipped( - 'TLS is not configured for your system. It is not possible to run this test' - ); - } - if (!defined('SWIFT_TLS_HOST')) { - $this->markTestSkipped( - 'Cannot run test without a TLS enabled SMTP host to connect to (define '. - 'SWIFT_TLS_HOST in tests/acceptance.conf.php if you wish to run this test)' - ); - } - parent::setUp(); - } - - protected function initializeBuffer() - { - $parts = explode(':', SWIFT_TLS_HOST); - $host = $parts[0]; - $port = $parts[1] ?? 25; - - $this->buffer->initialize([ - 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, - 'host' => $host, - 'port' => $port, - 'protocol' => 'tls', - 'blocking' => 1, - 'timeout' => 15, - ]); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bootstrap.php b/vendor/swiftmailer/swiftmailer/tests/bootstrap.php deleted file mode 100644 index 27091a28e..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bootstrap.php +++ /dev/null @@ -1,21 +0,0 @@ -allowMockingNonExistentMethods(true); - -if (is_file(__DIR__.'/acceptance.conf.php')) { - require_once __DIR__.'/acceptance.conf.php'; -} -if (is_file(__DIR__.'/smoke.conf.php')) { - require_once __DIR__.'/smoke.conf.php'; -} -require_once __DIR__.'/StreamCollector.php'; -require_once __DIR__.'/IdenticalBinaryConstraint.php'; -require_once __DIR__.'/SwiftMailerTestCase.php'; -require_once __DIR__.'/SwiftMailerSmokeTestCase.php'; diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php deleted file mode 100644 index e9085a99f..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug111Test.php +++ /dev/null @@ -1,42 +0,0 @@ - [ - 'email1@example.com', - 'email2@example.com', - 'email3@example.com', - 'email4@example.com', - 'email5@example.com', - ], - 'sub' => [ - '-name-' => [ - 'email1', - '"email2"', - 'email3\\', - 'email4', - 'email5', - ], - '-url-' => [ - 'http://google.com', - 'http://yahoo.com', - 'http://hotmail.com', - 'http://aol.com', - 'http://facebook.com', - ], - ], - ]; - $json = json_encode($complicated_header); - - $message = new Swift_Message(); - $headers = $message->getHeaders(); - $headers->addTextHeader('X-SMTPAPI', $json); - $header = $headers->get('X-SMTPAPI'); - - $this->assertEquals('Swift_Mime_Headers_UnstructuredHeader', get_class($header)); - $this->assertEquals($json, $header->getFieldBody()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php deleted file mode 100644 index 34aa13635..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug118Test.php +++ /dev/null @@ -1,20 +0,0 @@ -message = new Swift_Message(); - } - - public function testCallingGenerateIdChangesTheMessageId() - { - $currentId = $this->message->getId(); - $this->message->generateId(); - $newId = $this->message->getId(); - - $this->assertNotEquals($currentId, $newId); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php deleted file mode 100644 index 67c95510d..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug206Test.php +++ /dev/null @@ -1,40 +0,0 @@ -factory = new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $emailValidator); - } - - public function testMailboxHeaderEncoding() - { - $this->doTestHeaderIsFullyEncoded('email@example.org', 'Family Name, Name', ' "Family Name, Name" '); - $this->doTestHeaderIsFullyEncoded('email@example.org', 'Family Namé, Name', ' Family =?utf-8?Q?Nam=C3=A9=2C?= Name'); - $this->doTestHeaderIsFullyEncoded('email@example.org', 'Family Namé , Name', ' Family =?utf-8?Q?Nam=C3=A9_=2C?= Name'); - $this->doTestHeaderIsFullyEncoded('email@example.org', 'Family Namé ;Name', ' Family =?utf-8?Q?Nam=C3=A9_=3BName?= '); - } - - private function doTestHeaderIsFullyEncoded($email, $name, $expected) - { - $mailboxHeader = $this->factory->createMailboxHeader('To', [ - $email => $name, - ]); - - $headerBody = substr($mailboxHeader->toString(), 3, strlen($expected)); - - $this->assertEquals($expected, $headerBody); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php deleted file mode 100644 index ddf6ca13d..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php +++ /dev/null @@ -1,25 +0,0 @@ -attach(Swift_Attachment::fromPath('')); - } - - public function testNonEmptyFileNameAsAttachment() - { - $message = new Swift_Message(); - try { - $message->attach(Swift_Attachment::fromPath(__FILE__)); - } catch (Exception $e) { - $this->fail('Path should not be empty'); - } - $this->addToAssertionCount(1); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php deleted file mode 100644 index 0c8dd1755..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug34Test.php +++ /dev/null @@ -1,75 +0,0 @@ -setCharset('utf-8'); - } - - public function testEmbeddedFilesWithMultipartDataCreateMultipartRelatedContentAsAnAlternative() - { - $message = new Swift_Message(); - $message->setCharset('utf-8'); - $message->setSubject('test subject'); - $message->addPart('plain part', 'text/plain'); - - $image = new Swift_Image('', 'image.gif', 'image/gif'); - $cid = $message->embed($image); - - $message->setBody('', 'text/html'); - - $message->setTo(['user@domain.tld' => 'User']); - - $message->setFrom(['other@domain.tld' => 'Other']); - $message->setSender(['other@domain.tld' => 'Other']); - - $id = $message->getId(); - $date = preg_quote($message->getDate()->format('r'), '~'); - $boundary = $message->getBoundary(); - $cidVal = $image->getId(); - - $this->assertRegExp( - '~^'. - 'Sender: Other '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: Other '."\r\n". - 'To: User '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/plain; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'plain part'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - ''. - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: image/gif; name=image.gif'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.$cidVal.'>'."\r\n". - 'Content-Disposition: inline; filename=image.gif'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php deleted file mode 100644 index 66644e93e..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug35Test.php +++ /dev/null @@ -1,73 +0,0 @@ -setCharset('utf-8'); - } - - public function testHTMLPartAppearsLastEvenWhenAttachmentsAdded() - { - $message = new Swift_Message(); - $message->setCharset('utf-8'); - $message->setSubject('test subject'); - $message->addPart('plain part', 'text/plain'); - - $attachment = new Swift_Attachment('', 'image.gif', 'image/gif'); - $message->attach($attachment); - - $message->setBody('HTML part', 'text/html'); - - $message->setTo(['user@domain.tld' => 'User']); - - $message->setFrom(['other@domain.tld' => 'Other']); - $message->setSender(['other@domain.tld' => 'Other']); - - $id = $message->getId(); - $date = preg_quote($message->getDate()->format('r'), '~'); - $boundary = $message->getBoundary(); - - $this->assertRegExp( - '~^'. - 'Sender: Other '."\r\n". - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: Other '."\r\n". - 'To: User '."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: multipart/alternative;'."\r\n". - ' boundary="(.*?)"'."\r\n". - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/plain; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'plain part'. - "\r\n\r\n". - '--\\1'."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'HTML part'. - "\r\n\r\n". - '--\\1--'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: image/gif; name=image.gif'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename=image.gif'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $message->toString() - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php deleted file mode 100644 index 472c8058e..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug38Test.php +++ /dev/null @@ -1,192 +0,0 @@ -attFileName = 'data.txt'; - $this->attFileType = 'text/plain'; - $this->attFile = __DIR__.'/../../_samples/files/data.txt'; - Swift_Preferences::getInstance()->setCharset('utf-8'); - } - - public function testWritingMessageToByteStreamProducesCorrectStructure() - { - $message = new Swift_Message(); - $message->setSubject('test subject'); - $message->setTo('user@domain.tld'); - $message->setCc('other@domain.tld'); - $message->setFrom('user@domain.tld'); - - $image = new Swift_Image('', 'image.gif', 'image/gif'); - - $cid = $message->embed($image); - $message->setBody('HTML part', 'text/html'); - - $id = $message->getId(); - $date = preg_quote($message->getDate()->format('r'), '~'); - $boundary = $message->getBoundary(); - $imgId = $image->getId(); - - $stream = new Swift_ByteStream_ArrayByteStream(); - - $message->toByteStream($stream); - - $this->assertPatternInStream( - '~^'. - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: user@domain.tld'."\r\n". - 'To: user@domain.tld'."\r\n". - 'Cc: other@domain.tld'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'HTML part'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: image/gif; name=image.gif'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.preg_quote($imgId, '~').'>'."\r\n". - 'Content-Disposition: inline; filename=image.gif'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D', - $stream - ); - } - - public function testWritingMessageToByteStreamTwiceProducesCorrectStructure() - { - $message = new Swift_Message(); - $message->setSubject('test subject'); - $message->setTo('user@domain.tld'); - $message->setCc('other@domain.tld'); - $message->setFrom('user@domain.tld'); - - $image = new Swift_Image('', 'image.gif', 'image/gif'); - - $cid = $message->embed($image); - $message->setBody('HTML part', 'text/html'); - - $id = $message->getId(); - $date = preg_quote($message->getDate()->format('r'), '~'); - $boundary = $message->getBoundary(); - $imgId = $image->getId(); - - $pattern = '~^'. - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: user@domain.tld'."\r\n". - 'To: user@domain.tld'."\r\n". - 'Cc: other@domain.tld'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/related;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'HTML part'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: image/gif; name=image.gif'."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-ID: <'.preg_quote($imgId, '~').'>'."\r\n". - 'Content-Disposition: inline; filename=image.gif'."\r\n". - "\r\n". - preg_quote(base64_encode(''), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D' - ; - - $streamA = new Swift_ByteStream_ArrayByteStream(); - $streamB = new Swift_ByteStream_ArrayByteStream(); - - $message->toByteStream($streamA); - $message->toByteStream($streamB); - - $this->assertPatternInStream($pattern, $streamA); - $this->assertPatternInStream($pattern, $streamB); - } - - public function testWritingMessageToByteStreamTwiceUsingAFileAttachment() - { - $message = new Swift_Message(); - $message->setSubject('test subject'); - $message->setTo('user@domain.tld'); - $message->setCc('other@domain.tld'); - $message->setFrom('user@domain.tld'); - - $attachment = Swift_Attachment::fromPath($this->attFile); - - $message->attach($attachment); - - $message->setBody('HTML part', 'text/html'); - - $id = $message->getId(); - $date = preg_quote($message->getDate()->format('r'), '~'); - $boundary = $message->getBoundary(); - - $streamA = new Swift_ByteStream_ArrayByteStream(); - $streamB = new Swift_ByteStream_ArrayByteStream(); - - $pattern = '~^'. - 'Message-ID: <'.$id.'>'."\r\n". - 'Date: '.$date."\r\n". - 'Subject: test subject'."\r\n". - 'From: user@domain.tld'."\r\n". - 'To: user@domain.tld'."\r\n". - 'Cc: other@domain.tld'."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: multipart/mixed;'."\r\n". - ' boundary="'.$boundary.'"'."\r\n". - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: text/html; charset=utf-8'."\r\n". - 'Content-Transfer-Encoding: quoted-printable'."\r\n". - "\r\n". - 'HTML part'. - "\r\n\r\n". - '--'.$boundary."\r\n". - 'Content-Type: '.$this->attFileType.'; name='.$this->attFileName."\r\n". - 'Content-Transfer-Encoding: base64'."\r\n". - 'Content-Disposition: attachment; filename='.$this->attFileName."\r\n". - "\r\n". - preg_quote(base64_encode(file_get_contents($this->attFile)), '~'). - "\r\n\r\n". - '--'.$boundary.'--'."\r\n". - '$~D' - ; - - $message->toByteStream($streamA); - $message->toByteStream($streamB); - - $this->assertPatternInStream($pattern, $streamA); - $this->assertPatternInStream($pattern, $streamB); - } - - public function assertPatternInStream($pattern, $stream, $message = '%s') - { - $string = ''; - while (false !== $bytes = $stream->read(8192)) { - $string .= $bytes; - } - $this->assertRegExp($pattern, $string, $message); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug518Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug518Test.php deleted file mode 100644 index e4d1d7c04..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug518Test.php +++ /dev/null @@ -1,38 +0,0 @@ -setTo('foo@bar.com'); - - $that = $this; - $messageValidation = function ($m) use ($that) { - //the getTo should return the same value as we put in - $that->assertEquals('foo@bar.com', key($m->getTo()), 'The message has changed after it was put to the memory queue'); - - return true; - }; - - $transport = m::mock('Swift_Transport'); - $transport->shouldReceive('isStarted')->andReturn(true); - $transport->shouldReceive('send') - ->with(m::on($messageValidation), $failedRecipients) - ->andReturn(1); - - $memorySpool = new Swift_MemorySpool(); - $memorySpool->queueMessage($message); - - /* - * The message is queued in memory. - * Lets change the message - */ - $message->setTo('other@value.com'); - - $memorySpool->flushQueue($transport, $failedRecipients); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php deleted file mode 100644 index fdeb89b96..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug51Test.php +++ /dev/null @@ -1,110 +0,0 @@ -attachmentFile = sys_get_temp_dir().'/attach.rand.bin'; - file_put_contents($this->attachmentFile, ''); - - $this->outputFile = sys_get_temp_dir().'/attach.out.bin'; - file_put_contents($this->outputFile, ''); - } - - protected function tearDown() - { - unlink($this->attachmentFile); - unlink($this->outputFile); - } - - public function testAttachmentsDoNotGetTruncatedUsingToByteStream() - { - //Run 100 times with 10KB attachments - for ($i = 0; $i < 10; ++$i) { - $message = $this->createMessageWithRandomAttachment( - 10000, $this->attachmentFile - ); - - file_put_contents($this->outputFile, ''); - $message->toByteStream( - new Swift_ByteStream_FileByteStream($this->outputFile, true) - ); - - $emailSource = file_get_contents($this->outputFile); - - $this->assertAttachmentFromSourceMatches( - file_get_contents($this->attachmentFile), - $emailSource - ); - } - } - - public function testAttachmentsDoNotGetTruncatedUsingToString() - { - //Run 100 times with 10KB attachments - for ($i = 0; $i < 10; ++$i) { - $message = $this->createMessageWithRandomAttachment( - 10000, $this->attachmentFile - ); - - $emailSource = $message->toString(); - - $this->assertAttachmentFromSourceMatches( - file_get_contents($this->attachmentFile), - $emailSource - ); - } - } - - public function assertAttachmentFromSourceMatches($attachmentData, $source) - { - $encHeader = 'Content-Transfer-Encoding: base64'; - $base64declaration = strpos($source, $encHeader); - - $attachmentDataStart = strpos($source, "\r\n\r\n", $base64declaration); - $attachmentDataEnd = strpos($source, "\r\n--", $attachmentDataStart); - - if (false === $attachmentDataEnd) { - $attachmentBase64 = trim(substr($source, $attachmentDataStart)); - } else { - $attachmentBase64 = trim(substr( - $source, $attachmentDataStart, - $attachmentDataEnd - $attachmentDataStart - )); - } - - $this->assertIdenticalBinary($attachmentData, base64_decode($attachmentBase64)); - } - - private function fillFileWithRandomBytes($byteCount, $file) - { - // I was going to use dd with if=/dev/random but this way seems more - // cross platform even if a hella expensive!! - - file_put_contents($file, ''); - $fp = fopen($file, 'wb'); - for ($i = 0; $i < $byteCount; ++$i) { - $byteVal = random_int(0, 255); - fwrite($fp, pack('i', $byteVal)); - } - fclose($fp); - } - - private function createMessageWithRandomAttachment($size, $attachmentPath) - { - $this->fillFileWithRandomBytes($size, $attachmentPath); - - $message = (new Swift_Message()) - ->setSubject('test') - ->setBody('test') - ->setFrom('a@b.c') - ->setTo('d@e.f') - ->attach(Swift_Attachment::fromPath($attachmentPath)) - ; - - return $message; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug534Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug534Test.php deleted file mode 100644 index 6b224f1d9..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug534Test.php +++ /dev/null @@ -1,38 +0,0 @@ -setFrom('from@example.com') - ->setTo('to@example.com') - ->setSubject('test') - ; - $cid = $message->embed(Swift_Image::fromPath(__DIR__.'/../../_samples/files/swiftmailer.png')); - $message->setBody('', 'text/html'); - - $that = $this; - $messageValidation = function (Swift_Mime_SimpleMessage $message) use ($that) { - preg_match('/cid:(.*)"/', $message->toString(), $matches); - $cid = $matches[1]; - preg_match('/Content-ID: <(.*)>/', $message->toString(), $matches); - $contentId = $matches[1]; - $that->assertEquals($cid, $contentId, 'cid in body and mime part Content-ID differ'); - - return true; - }; - - $failedRecipients = []; - - $transport = m::mock('Swift_Transport'); - $transport->shouldReceive('isStarted')->andReturn(true); - $transport->shouldReceive('send')->with(m::on($messageValidation), $failedRecipients)->andReturn(1); - - $memorySpool = new Swift_MemorySpool(); - $memorySpool->queueMessage($message); - $memorySpool->flushQueue($transport, $failedRecipients); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug650Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug650Test.php deleted file mode 100644 index 31036c6ba..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug650Test.php +++ /dev/null @@ -1,38 +0,0 @@ -setCharset('utf-8'); - - $header->setNameAddresses([ - 'test@example.com' => $name, - ]); - - $this->assertSame('To: '.$expectedEncodedName." \r\n", $header->toString()); - } - - public function encodingDataProvider() - { - return [ - ['this is " a test ö', 'this is =?utf-8?Q?=22?= a test =?utf-8?Q?=C3=B6?='], - [': this is a test ö', '=?utf-8?Q?=3A?= this is a test =?utf-8?Q?=C3=B6?='], - ['( test ö', '=?utf-8?Q?=28?= test =?utf-8?Q?=C3=B6?='], - ['[ test ö', '=?utf-8?Q?=5B?= test =?utf-8?Q?=C3=B6?='], - ['@ test ö)', '=?utf-8?Q?=40?= test =?utf-8?Q?=C3=B6=29?='], - ]; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php deleted file mode 100644 index 3075f6767..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug71Test.php +++ /dev/null @@ -1,20 +0,0 @@ -message = new Swift_Message('test'); - } - - public function testCallingToStringAfterSettingNewBodyReflectsChanges() - { - $this->message->setBody('BODY1'); - $this->assertRegExp('/BODY1/', $this->message->toString()); - - $this->message->setBody('BODY2'); - $this->assertRegExp('/BODY2/', $this->message->toString()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php deleted file mode 100644 index 1db203570..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug76Test.php +++ /dev/null @@ -1,71 +0,0 @@ -inputFile = sys_get_temp_dir().'/in.bin'; - file_put_contents($this->inputFile, ''); - - $this->outputFile = sys_get_temp_dir().'/out.bin'; - file_put_contents($this->outputFile, ''); - - $this->encoder = $this->createEncoder(); - } - - protected function tearDown() - { - unlink($this->inputFile); - unlink($this->outputFile); - } - - public function testBase64EncodedLineLengthNeverExceeds76CharactersEvenIfArgsDo() - { - $this->fillFileWithRandomBytes(1000, $this->inputFile); - - $os = $this->createStream($this->inputFile); - $is = $this->createStream($this->outputFile); - - $this->encoder->encodeByteStream($os, $is, 0, 80); //Exceeds 76 - - $this->assertMaxLineLength(76, $this->outputFile, - '%s: Line length should not exceed 76 characters' - ); - } - - public function assertMaxLineLength($length, $filePath, $message = '%s') - { - $lines = file($filePath); - foreach ($lines as $line) { - $this->assertTrue((strlen(trim($line)) <= 76), $message); - } - } - - private function fillFileWithRandomBytes($byteCount, $file) - { - // I was going to use dd with if=/dev/random but this way seems more - // cross platform even if a hella expensive!! - - file_put_contents($file, ''); - $fp = fopen($file, 'wb'); - for ($i = 0; $i < $byteCount; ++$i) { - $byteVal = random_int(0, 255); - fwrite($fp, pack('i', $byteVal)); - } - fclose($fp); - } - - private function createEncoder() - { - return new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - } - - private function createStream($file) - { - return new Swift_ByteStream_FileByteStream($file, true); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php deleted file mode 100644 index eb5807196..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php +++ /dev/null @@ -1,18 +0,0 @@ -read(100); - } catch (\Swift_IoException $exc) { - $fbs->read(100); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/fixtures/MimeEntityFixture.php b/vendor/swiftmailer/swiftmailer/tests/fixtures/MimeEntityFixture.php deleted file mode 100644 index 8a6603938..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/fixtures/MimeEntityFixture.php +++ /dev/null @@ -1,67 +0,0 @@ -level = $level; - $this->string = $string; - $this->contentType = $contentType; - } - - public function getNestingLevel() - { - return $this->level; - } - - public function toString() - { - return $this->string; - } - - public function getContentType() - { - return $this->contentType; - } - - // These methods are here to account for the implemented interfaces - public function getId() - { - } - - public function getHeaders() - { - } - - public function getBody() - { - } - - public function setBody($body, $contentType = null) - { - } - - public function toByteStream(Swift_InputByteStream $is) - { - } - - public function charsetChanged($charset) - { - } - - public function encoderChanged(Swift_Mime_ContentEncoder $encoder) - { - } - - public function getChildren() - { - } - - public function setChildren(array $children, $compoundLevel = null) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default b/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default deleted file mode 100644 index 604d6de71..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/smoke.conf.php.default +++ /dev/null @@ -1,63 +0,0 @@ -attFile = __DIR__.'/../../../_samples/files/textfile.zip'; - } - - public function testAttachmentSending() - { - $mailer = $this->getMailer(); - $message = (new Swift_Message()) - ->setSubject('[Swift Mailer] AttachmentSmokeTest') - ->setFrom([SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer']) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->setBody('This message should contain an attached ZIP file (named "textfile.zip").'.PHP_EOL. - 'When unzipped, the archive should produce a text file which reads:'.PHP_EOL. - '"This is part of a Swift Mailer smoke test."' - ) - ->attach(Swift_Attachment::fromPath($this->attFile)) - ; - $this->assertEquals(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php deleted file mode 100644 index 79915b342..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php +++ /dev/null @@ -1,23 +0,0 @@ -getMailer(); - $message = (new Swift_Message()) - ->setSubject('[Swift Mailer] BasicSmokeTest') - ->setFrom([SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer']) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->setBody('One, two, three, four, five...'.PHP_EOL. - 'six, seven, eight...' - ) - ; - $this->assertEquals(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php deleted file mode 100644 index 5ed6c33b0..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php +++ /dev/null @@ -1,33 +0,0 @@ -attFile = __DIR__.'/../../../_samples/files/textfile.zip'; - } - - public function testAttachmentSending() - { - $mailer = $this->getMailer(); - $message = (new Swift_Message('[Swift Mailer] HtmlWithAttachmentSmokeTest')) - ->setFrom([SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer']) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->attach(Swift_Attachment::fromPath($this->attFile)) - ->setBody('

This HTML-formatted message should contain an attached ZIP file (named "textfile.zip").'.PHP_EOL. - 'When unzipped, the archive should produce a text file which reads:

'.PHP_EOL. - '

This is part of a Swift Mailer smoke test.

', 'text/html' - ) - ; - $this->assertEquals(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php deleted file mode 100644 index 6dc715e89..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php +++ /dev/null @@ -1,40 +0,0 @@ -attFile = __DIR__.'/../../../_samples/files/textfile.zip'; - } - - public function testAttachmentSending() - { - $mailer = $this->getMailer(); - $message = (new Swift_Message()) - ->setCharset('utf-8') - ->setSubject('[Swift Mailer] InternationalSmokeTest (διεθνής)') - ->setFrom([SWIFT_SMOKE_EMAIL_ADDRESS => 'Χριστοφορου (Swift Mailer)']) - ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) - ->setBody('This message should contain an attached ZIP file (named "κείμενο, εδάφιο, θέμα.zip").'.PHP_EOL. - 'When unzipped, the archive should produce a text file which reads:'.PHP_EOL. - '"This is part of a Swift Mailer smoke test."'.PHP_EOL. - PHP_EOL. - 'Following is some arbitrary Greek text:'.PHP_EOL. - 'Δεν βρέθηκαν λέξεις.' - ) - ->attach(Swift_Attachment::fromPath($this->attFile) - ->setContentType('application/zip') - ->setFilename('κείμενο, εδάφιο, θέμα.zip') - ) - ; - $this->assertEquals(1, $mailer->send($message), - '%s: The smoke test should send a single message' - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php deleted file mode 100644 index 29fe390f0..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/ByteStream/ArrayByteStreamTest.php +++ /dev/null @@ -1,202 +0,0 @@ -createArrayStream($input); - $output = []; - while (false !== $bytes = $bs->read(1)) { - $output[] = $bytes; - } - $this->assertEquals($input, $output, - '%s: Bytes read from stream should be the same as bytes in constructor' - ); - } - - public function testReadingMultipleBytesFromBaseInput() - { - $input = ['a', 'b', 'c', 'd']; - $bs = $this->createArrayStream($input); - $output = []; - while (false !== $bytes = $bs->read(2)) { - $output[] = $bytes; - } - $this->assertEquals(['ab', 'cd'], $output, - '%s: Bytes read from stream should be in pairs' - ); - } - - public function testReadingOddOffsetOnLastByte() - { - $input = ['a', 'b', 'c', 'd', 'e']; - $bs = $this->createArrayStream($input); - $output = []; - while (false !== $bytes = $bs->read(2)) { - $output[] = $bytes; - } - $this->assertEquals(['ab', 'cd', 'e'], $output, - '%s: Bytes read from stream should be in pairs except final read' - ); - } - - public function testSettingPointerPartway() - { - $input = ['a', 'b', 'c']; - $bs = $this->createArrayStream($input); - $bs->setReadPointer(1); - $this->assertEquals('b', $bs->read(1), - '%s: Byte should be second byte since pointer as at offset 1' - ); - } - - public function testResettingPointerAfterExhaustion() - { - $input = ['a', 'b', 'c']; - - $bs = $this->createArrayStream($input); - while (false !== $bs->read(1)); - - $bs->setReadPointer(0); - $this->assertEquals('a', $bs->read(1), - '%s: Byte should be first byte since pointer as at offset 0' - ); - } - - public function testPointerNeverSetsBelowZero() - { - $input = ['a', 'b', 'c']; - $bs = $this->createArrayStream($input); - - $bs->setReadPointer(-1); - $this->assertEquals('a', $bs->read(1), - '%s: Byte should be first byte since pointer should be at offset 0' - ); - } - - public function testPointerNeverSetsAboveStackSize() - { - $input = ['a', 'b', 'c']; - $bs = $this->createArrayStream($input); - - $bs->setReadPointer(3); - $this->assertFalse($bs->read(1), - '%s: Stream should be at end and thus return false' - ); - } - - public function testBytesCanBeWrittenToStream() - { - $input = ['a', 'b', 'c']; - $bs = $this->createArrayStream($input); - - $bs->write('de'); - - $output = []; - while (false !== $bytes = $bs->read(1)) { - $output[] = $bytes; - } - $this->assertEquals(['a', 'b', 'c', 'd', 'e'], $output, - '%s: Bytes read from stream should be from initial stack + written' - ); - } - - public function testContentsCanBeFlushed() - { - $input = ['a', 'b', 'c']; - $bs = $this->createArrayStream($input); - - $bs->flushBuffers(); - - $this->assertFalse($bs->read(1), - '%s: Contents have been flushed so read() should return false' - ); - } - - public function testConstructorCanTakeStringArgument() - { - $bs = $this->createArrayStream('abc'); - $output = []; - while (false !== $bytes = $bs->read(1)) { - $output[] = $bytes; - } - $this->assertEquals(['a', 'b', 'c'], $output, - '%s: Bytes read from stream should be the same as bytes in constructor' - ); - } - - public function testBindingOtherStreamsMirrorsWriteOperations() - { - $bs = $this->createArrayStream(''); - $is1 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - $is2 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->at(0)) - ->method('write') - ->with('x'); - $is2->expects($this->at(1)) - ->method('write') - ->with('y'); - - $bs->bind($is1); - $bs->bind($is2); - - $bs->write('x'); - $bs->write('y'); - } - - public function testBindingOtherStreamsMirrorsFlushOperations() - { - $bs = $this->createArrayStream(''); - $is1 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - $is2 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - - $is1->expects($this->once()) - ->method('flushBuffers'); - $is2->expects($this->once()) - ->method('flushBuffers'); - - $bs->bind($is1); - $bs->bind($is2); - - $bs->flushBuffers(); - } - - public function testUnbindingStreamPreventsFurtherWrites() - { - $bs = $this->createArrayStream(''); - $is1 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - $is2 = $this->getMockBuilder('Swift_InputByteStream')->getMock(); - - $is1->expects($this->at(0)) - ->method('write') - ->with('x'); - $is1->expects($this->at(1)) - ->method('write') - ->with('y'); - $is2->expects($this->once()) - ->method('write') - ->with('x'); - - $bs->bind($is1); - $bs->bind($is2); - - $bs->write('x'); - - $bs->unbind($is2); - - $bs->write('y'); - } - - private function createArrayStream($input) - { - return new Swift_ByteStream_ArrayByteStream($input); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php deleted file mode 100644 index 1ba5e784c..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/GenericFixedWidthReaderTest.php +++ /dev/null @@ -1,43 +0,0 @@ -assertSame(1, $reader->getInitialByteSize()); - - $reader = new Swift_CharacterReader_GenericFixedWidthReader(4); - $this->assertSame(4, $reader->getInitialByteSize()); - } - - public function testValidationValueIsBasedOnOctetCount() - { - $reader = new Swift_CharacterReader_GenericFixedWidthReader(4); - - $this->assertSame( - 1, $reader->validateByteSequence([0x01, 0x02, 0x03], 3) - ); //3 octets - - $this->assertSame( - 2, $reader->validateByteSequence([0x01, 0x0A], 2) - ); //2 octets - - $this->assertSame( - 3, $reader->validateByteSequence([0xFE], 1) - ); //1 octet - - $this->assertSame( - 0, $reader->validateByteSequence([0xFE, 0x03, 0x67, 0x9A], 4) - ); //All 4 octets - } - - public function testValidationFailsIfTooManyOctets() - { - $reader = new Swift_CharacterReader_GenericFixedWidthReader(6); - - $this->assertSame(-1, $reader->validateByteSequence( - [0xFE, 0x03, 0x67, 0x9A, 0x10, 0x09, 0x85], 7 - )); //7 octets - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php deleted file mode 100644 index b85b0ab1b..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/UsAsciiReaderTest.php +++ /dev/null @@ -1,52 +0,0 @@ -read($size); ) { - $c .= $bytes; - $size = $v->validateCharacter($c); - if (-1 == $size) { - throw new Exception( ... invalid char .. ); - } elseif (0 == $size) { - return $c; //next character in $os - } - } - - */ - - private $reader; - - protected function setUp() - { - $this->reader = new Swift_CharacterReader_UsAsciiReader(); - } - - public function testAllValidAsciiCharactersReturnZero() - { - for ($ordinal = 0x00; $ordinal <= 0x7F; ++$ordinal) { - $this->assertSame( - 0, $this->reader->validateByteSequence([$ordinal], 1) - ); - } - } - - public function testMultipleBytesAreInvalid() - { - for ($ordinal = 0x00; $ordinal <= 0x7F; $ordinal += 2) { - $this->assertSame( - -1, $this->reader->validateByteSequence([$ordinal, $ordinal + 1], 2) - ); - } - } - - public function testBytesAboveAsciiRangeAreInvalid() - { - for ($ordinal = 0x80; $ordinal <= 0xFF; ++$ordinal) { - $this->assertSame( - -1, $this->reader->validateByteSequence([$ordinal], 1) - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php deleted file mode 100644 index 06379118c..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterReader/Utf8ReaderTest.php +++ /dev/null @@ -1,65 +0,0 @@ -reader = new Swift_CharacterReader_Utf8Reader(); - } - - public function testLeading7BitOctetCausesReturnZero() - { - for ($ordinal = 0x00; $ordinal <= 0x7F; ++$ordinal) { - $this->assertSame( - 0, $this->reader->validateByteSequence([$ordinal], 1) - ); - } - } - - public function testLeadingByteOf2OctetCharCausesReturn1() - { - for ($octet = 0xC0; $octet <= 0xDF; ++$octet) { - $this->assertSame( - 1, $this->reader->validateByteSequence([$octet], 1) - ); - } - } - - public function testLeadingByteOf3OctetCharCausesReturn2() - { - for ($octet = 0xE0; $octet <= 0xEF; ++$octet) { - $this->assertSame( - 2, $this->reader->validateByteSequence([$octet], 1) - ); - } - } - - public function testLeadingByteOf4OctetCharCausesReturn3() - { - for ($octet = 0xF0; $octet <= 0xF7; ++$octet) { - $this->assertSame( - 3, $this->reader->validateByteSequence([$octet], 1) - ); - } - } - - public function testLeadingByteOf5OctetCharCausesReturn4() - { - for ($octet = 0xF8; $octet <= 0xFB; ++$octet) { - $this->assertSame( - 4, $this->reader->validateByteSequence([$octet], 1) - ); - } - } - - public function testLeadingByteOf6OctetCharCausesReturn5() - { - for ($octet = 0xFC; $octet <= 0xFD; ++$octet) { - $this->assertSame( - 5, $this->reader->validateByteSequence([$octet], 1) - ); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php deleted file mode 100644 index d0158a236..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/CharacterStream/ArrayCharacterStreamTest.php +++ /dev/null @@ -1,358 +0,0 @@ -getReader(); - $factory = $this->getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - - $stream->importString(pack('C*', - 0xD0, 0x94, - 0xD0, 0xB6, - 0xD0, 0xBE, - 0xD1, 0x8D, - 0xD0, 0xBB, - 0xD0, 0xB0 - ) - ); - } - - public function testCharactersWrittenUseValidator() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->write(pack('C*', - 0xD0, 0xBB, - 0xD1, 0x8E, - 0xD0, 0xB1, - 0xD1, 0x8B, - 0xD1, 0x85 - ) - ); - } - - public function testReadCharactersAreInTact() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - //String - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - //Stream - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->write(pack('C*', - 0xD0, 0xBB, - 0xD1, 0x8E, - 0xD0, 0xB1, - 0xD1, 0x8B, - 0xD1, 0x85 - ) - ); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - $this->assertIdenticalBinary( - pack('C*', 0xD0, 0xB6, 0xD0, 0xBE), $stream->read(2) - ); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBB), $stream->read(1)); - $this->assertIdenticalBinary( - pack('C*', 0xD1, 0x8E, 0xD0, 0xB1, 0xD1, 0x8B), $stream->read(3) - ); - $this->assertIdenticalBinary(pack('C*', 0xD1, 0x85), $stream->read(1)); - - $this->assertFalse($stream->read(1)); - } - - public function testCharactersCanBeReadAsByteArrays() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - //String - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - //Stream - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1], 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->write(pack('C*', - 0xD0, 0xBB, - 0xD1, 0x8E, - 0xD0, 0xB1, - 0xD1, 0x8B, - 0xD1, 0x85 - ) - ); - - $this->assertEquals([0xD0, 0x94], $stream->readBytes(1)); - $this->assertEquals([0xD0, 0xB6, 0xD0, 0xBE], $stream->readBytes(2)); - $this->assertEquals([0xD0, 0xBB], $stream->readBytes(1)); - $this->assertEquals( - [0xD1, 0x8E, 0xD0, 0xB1, 0xD1, 0x8B], $stream->readBytes(3) - ); - $this->assertEquals([0xD1, 0x85], $stream->readBytes(1)); - - $this->assertFalse($stream->readBytes(1)); - } - - public function testRequestingLargeCharCountPastEndOfStream() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE), - $stream->read(100) - ); - - $this->assertFalse($stream->read(1)); - } - - public function testRequestingByteArrayCountPastEndOfStream() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $this->assertEquals([0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE], - $stream->readBytes(100) - ); - - $this->assertFalse($stream->readBytes(1)); - } - - public function testPointerOffsetCanBeSet() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - - $stream->setPointer(0); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - - $stream->setPointer(2); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBE), $stream->read(1)); - } - - public function testContentsCanBeFlushed() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - - $stream->importString(pack('C*', 0xD0, 0x94, 0xD0, 0xB6, 0xD0, 0xBE)); - - $stream->flushContents(); - - $this->assertFalse($stream->read(1)); - } - - public function testByteStreamCanBeImportingUsesValidator() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - $os = $this->getByteStream(); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $os->shouldReceive('setReadPointer') - ->between(0, 1) - ->with(0); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0x94)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xB6)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xBE)); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - - $stream->importByteStream($os); - } - - public function testImportingStreamProducesCorrectCharArray() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - $os = $this->getByteStream(); - - $stream = new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'); - - $os->shouldReceive('setReadPointer') - ->between(0, 1) - ->with(0); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0x94)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xB6)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xD0)); - $os->shouldReceive('read')->once()->andReturn(pack('C*', 0xBE)); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0], 1)->andReturn(1); - - $stream->importByteStream($os); - - $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xB6), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBE), $stream->read(1)); - - $this->assertFalse($stream->read(1)); - } - - public function testAlgorithmWithFixedWidthCharsets() - { - $reader = $this->getReader(); - $factory = $this->getFactory($reader); - - $reader->shouldReceive('getInitialByteSize') - ->zeroOrMoreTimes() - ->andReturn(2); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD1, 0x8D], 2); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0, 0xBB], 2); - $reader->shouldReceive('validateByteSequence')->once()->with([0xD0, 0xB0], 2); - - $stream = new Swift_CharacterStream_ArrayCharacterStream( - $factory, 'utf-8' - ); - $stream->importString(pack('C*', 0xD1, 0x8D, 0xD0, 0xBB, 0xD0, 0xB0)); - - $this->assertIdenticalBinary(pack('C*', 0xD1, 0x8D), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBB), $stream->read(1)); - $this->assertIdenticalBinary(pack('C*', 0xD0, 0xB0), $stream->read(1)); - - $this->assertFalse($stream->read(1)); - } - - private function getReader() - { - return $this->getMockery('Swift_CharacterReader'); - } - - private function getFactory($reader) - { - $factory = $this->getMockery('Swift_CharacterReaderFactory'); - $factory->shouldReceive('getReaderFor') - ->zeroOrMoreTimes() - ->with('utf-8') - ->andReturn($reader); - - return $factory; - } - - private function getByteStream() - { - return $this->getMockery('Swift_OutputByteStream'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php deleted file mode 100644 index 286f83281..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/DependencyContainerTest.php +++ /dev/null @@ -1,191 +0,0 @@ -arg1 = $arg1; - $this->arg2 = $arg2; - } -} - -class Swift_DependencyContainerTest extends \PHPUnit\Framework\TestCase -{ - private $container; - - protected function setUp() - { - $this->container = new Swift_DependencyContainer(); - } - - public function testRegisterAndLookupValue() - { - $this->container->register('foo')->asValue('bar'); - $this->assertEquals('bar', $this->container->lookup('foo')); - } - - public function testHasReturnsTrueForRegisteredValue() - { - $this->container->register('foo')->asValue('bar'); - $this->assertTrue($this->container->has('foo')); - } - - public function testHasReturnsFalseForUnregisteredValue() - { - $this->assertFalse($this->container->has('foo')); - } - - public function testRegisterAndLookupNewInstance() - { - $this->container->register('one')->asNewInstanceOf('One'); - $this->assertInstanceOf('One', $this->container->lookup('one')); - } - - public function testHasReturnsTrueForRegisteredInstance() - { - $this->container->register('one')->asNewInstanceOf('One'); - $this->assertTrue($this->container->has('one')); - } - - public function testNewInstanceIsAlwaysNew() - { - $this->container->register('one')->asNewInstanceOf('One'); - $a = $this->container->lookup('one'); - $b = $this->container->lookup('one'); - $this->assertEquals($a, $b); - } - - public function testRegisterAndLookupSharedInstance() - { - $this->container->register('one')->asSharedInstanceOf('One'); - $this->assertInstanceOf('One', $this->container->lookup('one')); - } - - public function testHasReturnsTrueForSharedInstance() - { - $this->container->register('one')->asSharedInstanceOf('One'); - $this->assertTrue($this->container->has('one')); - } - - public function testMultipleSharedInstancesAreSameInstance() - { - $this->container->register('one')->asSharedInstanceOf('One'); - $a = $this->container->lookup('one'); - $b = $this->container->lookup('one'); - $this->assertEquals($a, $b); - } - - public function testRegisterAndLookupArray() - { - $this->container->register('One')->asArray(); - $this->assertSame([], $this->container->lookup('One')); - } - - public function testNewInstanceWithDependencies() - { - $this->container->register('foo')->asValue('FOO'); - $this->container->register('one')->asNewInstanceOf('One') - ->withDependencies(['foo']); - $obj = $this->container->lookup('one'); - $this->assertSame('FOO', $obj->arg1); - } - - public function testNewInstanceWithMultipleDependencies() - { - $this->container->register('foo')->asValue('FOO'); - $this->container->register('bar')->asValue(42); - $this->container->register('one')->asNewInstanceOf('One') - ->withDependencies(['foo', 'bar']); - $obj = $this->container->lookup('one'); - $this->assertSame('FOO', $obj->arg1); - $this->assertSame(42, $obj->arg2); - } - - public function testNewInstanceWithInjectedObjects() - { - $this->container->register('foo')->asValue('FOO'); - $this->container->register('one')->asNewInstanceOf('One'); - $this->container->register('two')->asNewInstanceOf('One') - ->withDependencies(['one', 'foo']); - $obj = $this->container->lookup('two'); - $this->assertEquals($this->container->lookup('one'), $obj->arg1); - $this->assertSame('FOO', $obj->arg2); - } - - public function testNewInstanceWithAddConstructorValue() - { - $this->container->register('one')->asNewInstanceOf('One') - ->addConstructorValue('x') - ->addConstructorValue(99); - $obj = $this->container->lookup('one'); - $this->assertSame('x', $obj->arg1); - $this->assertSame(99, $obj->arg2); - } - - public function testNewInstanceWithAddConstructorLookup() - { - $this->container->register('foo')->asValue('FOO'); - $this->container->register('bar')->asValue(42); - $this->container->register('one')->asNewInstanceOf('One') - ->addConstructorLookup('foo') - ->addConstructorLookup('bar'); - - $obj = $this->container->lookup('one'); - $this->assertSame('FOO', $obj->arg1); - $this->assertSame(42, $obj->arg2); - } - - public function testResolvedDependenciesCanBeLookedUp() - { - $this->container->register('foo')->asValue('FOO'); - $this->container->register('one')->asNewInstanceOf('One'); - $this->container->register('two')->asNewInstanceOf('One') - ->withDependencies(['one', 'foo']); - $deps = $this->container->createDependenciesFor('two'); - $this->assertEquals( - [$this->container->lookup('one'), 'FOO'], $deps - ); - } - - public function testArrayOfDependenciesCanBeSpecified() - { - $this->container->register('foo')->asValue('FOO'); - $this->container->register('one')->asNewInstanceOf('One'); - $this->container->register('two')->asNewInstanceOf('One') - ->withDependencies([['one', 'foo'], 'foo']); - - $obj = $this->container->lookup('two'); - $this->assertEquals([$this->container->lookup('one'), 'FOO'], $obj->arg1); - $this->assertSame('FOO', $obj->arg2); - } - - public function testArrayWithDependencies() - { - $this->container->register('foo')->asValue('FOO'); - $this->container->register('bar')->asValue(42); - $this->container->register('one')->asArray('One') - ->withDependencies(['foo', 'bar']); - $this->assertSame(['FOO', 42], $this->container->lookup('one')); - } - - public function testAliasCanBeSet() - { - $this->container->register('foo')->asValue('FOO'); - $this->container->register('bar')->asAliasOf('foo'); - - $this->assertSame('FOO', $this->container->lookup('bar')); - } - - public function testAliasOfAliasCanBeSet() - { - $this->container->register('foo')->asValue('FOO'); - $this->container->register('bar')->asAliasOf('foo'); - $this->container->register('zip')->asAliasOf('bar'); - $this->container->register('button')->asAliasOf('zip'); - - $this->assertSame('FOO', $this->container->lookup('button')); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php deleted file mode 100644 index 6387bad3b..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Base64EncoderTest.php +++ /dev/null @@ -1,173 +0,0 @@ -encoder = new Swift_Encoder_Base64Encoder(); - } - - /* - There's really no point in testing the entire base64 encoding to the - level QP encoding has been tested. base64_encode() has been in PHP for - years. - */ - - public function testInputOutputRatioIs3to4Bytes() - { - /* - RFC 2045, 6.8 - - The encoding process represents 24-bit groups of input bits as output - strings of 4 encoded characters. Proceeding from left to right, a - 24-bit input group is formed by concatenating 3 8bit input groups. - These 24 bits are then treated as 4 concatenated 6-bit groups, each - of which is translated into a single digit in the base64 alphabet. - */ - - $this->assertEquals( - 'MTIz', $this->encoder->encodeString('123'), - '%s: 3 bytes of input should yield 4 bytes of output' - ); - $this->assertEquals( - 'MTIzNDU2', $this->encoder->encodeString('123456'), - '%s: 6 bytes in input should yield 8 bytes of output' - ); - $this->assertEquals( - 'MTIzNDU2Nzg5', $this->encoder->encodeString('123456789'), - '%s: 9 bytes in input should yield 12 bytes of output' - ); - } - - public function testPadLength() - { - /* - RFC 2045, 6.8 - - Special processing is performed if fewer than 24 bits are available - at the end of the data being encoded. A full encoding quantum is - always completed at the end of a body. When fewer than 24 input bits - are available in an input group, zero bits are added (on the right) - to form an integral number of 6-bit groups. Padding at the end of - the data is performed using the "=" character. Since all base64 - input is an integral number of octets, only the following cases can - arise: (1) the final quantum of encoding input is an integral - multiple of 24 bits; here, the final unit of encoded output will be - an integral multiple of 4 characters with no "=" padding, (2) the - final quantum of encoding input is exactly 8 bits; here, the final - unit of encoded output will be two characters followed by two "=" - padding characters, or (3) the final quantum of encoding input is - exactly 16 bits; here, the final unit of encoded output will be three - characters followed by one "=" padding character. - */ - - for ($i = 0; $i < 30; ++$i) { - $input = pack('C', random_int(0, 255)); - $this->assertRegExp( - '~^[a-zA-Z0-9/\+]{2}==$~', $this->encoder->encodeString($input), - '%s: A single byte should have 2 bytes of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $input = pack('C*', random_int(0, 255), random_int(0, 255)); - $this->assertRegExp( - '~^[a-zA-Z0-9/\+]{3}=$~', $this->encoder->encodeString($input), - '%s: Two bytes should have 1 byte of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $input = pack('C*', random_int(0, 255), random_int(0, 255), random_int(0, 255)); - $this->assertRegExp( - '~^[a-zA-Z0-9/\+]{4}$~', $this->encoder->encodeString($input), - '%s: Three bytes should have no padding' - ); - } - } - - public function testMaximumLineLengthIs76Characters() - { - /* - The encoded output stream must be represented in lines of no more - than 76 characters each. All line breaks or other characters not - found in Table 1 must be ignored by decoding software. - */ - - $input = - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $output = - 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQk'.//38 - 'NERUZHSElKS0xNTk9QUVJTVFVWV1hZWjEyMzQ1'."\r\n".//76 * - 'Njc4OTBhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3'.//38 - 'h5ekFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFla'."\r\n".//76 * - 'MTIzNDU2Nzg5MEFCQ0RFRkdISUpLTE1OT1BRUl'.//38 - 'NUVVZXWFla'; //48 - - $this->assertEquals( - $output, $this->encoder->encodeString($input), - '%s: Lines should be no more than 76 characters' - ); - } - - public function testMaximumLineLengthCanBeSpecified() - { - $input = - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $output = - 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQk'.//38 - 'NERUZHSElKS0'."\r\n".//50 * - 'xNTk9QUVJTVFVWV1hZWjEyMzQ1Njc4OTBhYmNk'.//38 - 'ZWZnaGlqa2xt'."\r\n".//50 * - 'bm9wcXJzdHV2d3h5ekFCQ0RFRkdISUpLTE1OT1'.//38 - 'BRUlNUVVZXWF'."\r\n".//50 * - 'laMTIzNDU2Nzg5MEFCQ0RFRkdISUpLTE1OT1BR'.//38 - 'UlNUVVZXWFla'; //50 * - - $this->assertEquals( - $output, $this->encoder->encodeString($input, 0, 50), - '%s: Lines should be no more than 100 characters' - ); - } - - public function testFirstLineLengthCanBeDifferent() - { - $input = - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'abcdefghijklmnopqrstuvwxyz'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. - '1234567890'. - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - - $output = - 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQk'.//38 - 'NERUZHSElKS0xNTk9QU'."\r\n".//57 * - 'VJTVFVWV1hZWjEyMzQ1Njc4OTBhYmNkZWZnaGl'.//38 - 'qa2xtbm9wcXJzdHV2d3h5ekFCQ0RFRkdISUpLT'."\r\n".//76 * - 'E1OT1BRUlNUVVZXWFlaMTIzNDU2Nzg5MEFCQ0R'.//38 - 'FRkdISUpLTE1OT1BRUlNUVVZXWFla'; //67 - - $this->assertEquals( - $output, $this->encoder->encodeString($input, 19), - '%s: First line offset is 19 so first line should be 57 chars long' - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php deleted file mode 100644 index 10e5e1d0a..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/QpEncoderTest.php +++ /dev/null @@ -1,400 +0,0 @@ -createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($char); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([$ordinal]); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertIdenticalBinary($char, $encoder->encodeString($char)); - } - } - - public function testWhiteSpaceAtLineEndingIsEncoded() - { - /* -- RFC 2045, 6.7 -- - (3) (White Space) Octets with values of 9 and 32 MAY be - represented as US-ASCII TAB (HT) and SPACE characters, - respectively, but MUST NOT be so represented at the end - of an encoded line. Any TAB (HT) or SPACE characters - on an encoded line MUST thus be followed on that line - by a printable character. In particular, an "=" at the - end of an encoded line, indicating a soft line break - (see rule #5) may follow one or more TAB (HT) or SPACE - characters. It follows that an octet with decimal - value 9 or 32 appearing at the end of an encoded line - must be represented according to Rule #1. This rule is - necessary because some MTAs (Message Transport Agents, - programs which transport messages from one user to - another, or perform a portion of such transfers) are - known to pad lines of text with SPACEs, and others are - known to remove "white space" characters from the end - of a line. Therefore, when decoding a Quoted-Printable - body, any trailing white space on a line must be - deleted, as it will necessarily have been added by - intermediate transport agents. - */ - - $HT = chr(0x09); //9 - $SPACE = chr(0x20); //32 - - //HT - $string = 'a'.$HT.$HT."\r\n".'b'; - - $charStream = $this->createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - - $charStream->shouldReceive('readBytes')->once()->andReturn([ord('a')]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x09]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x09]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0D]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0A]); - $charStream->shouldReceive('readBytes')->once()->andReturn([ord('b')]); - $charStream->shouldReceive('readBytes')->once()->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals( - 'a'.$HT.'=09'."\r\n".'b', - $encoder->encodeString($string) - ); - - //SPACE - $string = 'a'.$SPACE.$SPACE."\r\n".'b'; - - $charStream = $this->createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - - $charStream->shouldReceive('readBytes')->once()->andReturn([ord('a')]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x20]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x20]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0D]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0A]); - $charStream->shouldReceive('readBytes')->once()->andReturn([ord('b')]); - $charStream->shouldReceive('readBytes')->once()->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals( - 'a'.$SPACE.'=20'."\r\n".'b', - $encoder->encodeString($string) - ); - } - - public function testCRLFIsLeftAlone() - { - /* - (4) (Line Breaks) A line break in a text body, represented - as a CRLF sequence in the text canonical form, must be - represented by a (RFC 822) line break, which is also a - CRLF sequence, in the Quoted-Printable encoding. Since - the canonical representation of media types other than - text do not generally include the representation of - line breaks as CRLF sequences, no hard line breaks - (i.e. line breaks that are intended to be meaningful - and to be displayed to the user) can occur in the - quoted-printable encoding of such types. Sequences - like "=0D", "=0A", "=0A=0D" and "=0D=0A" will routinely - appear in non-text data represented in quoted- - printable, of course. - - Note that many implementations may elect to encode the - local representation of various content types directly - rather than converting to canonical form first, - encoding, and then converting back to local - representation. In particular, this may apply to plain - text material on systems that use newline conventions - other than a CRLF terminator sequence. Such an - implementation optimization is permissible, but only - when the combined canonicalization-encoding step is - equivalent to performing the three steps separately. - */ - - $string = 'a'."\r\n".'b'."\r\n".'c'."\r\n"; - - $charStream = $this->createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - - $charStream->shouldReceive('readBytes')->once()->andReturn([ord('a')]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0D]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0A]); - $charStream->shouldReceive('readBytes')->once()->andReturn([ord('b')]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0D]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0A]); - $charStream->shouldReceive('readBytes')->once()->andReturn([ord('c')]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0D]); - $charStream->shouldReceive('readBytes')->once()->andReturn([0x0A]); - $charStream->shouldReceive('readBytes')->once()->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals($string, $encoder->encodeString($string)); - } - - public function testLinesLongerThan76CharactersAreSoftBroken() - { - /* - (5) (Soft Line Breaks) The Quoted-Printable encoding - REQUIRES that encoded lines be no more than 76 - characters long. If longer lines are to be encoded - with the Quoted-Printable encoding, "soft" line breaks - must be used. An equal sign as the last character on a - encoded line indicates such a non-significant ("soft") - line break in the encoded text. - */ - - $input = str_repeat('a', 140); - - $charStream = $this->createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($input); - - $output = ''; - for ($i = 0; $i < 140; ++$i) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - - if (75 == $i) { - $output .= "=\r\n"; - } - $output .= 'a'; - } - - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals($output, $encoder->encodeString($input)); - } - - public function testMaxLineLengthCanBeSpecified() - { - $input = str_repeat('a', 100); - - $charStream = $this->createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($input); - - $output = ''; - for ($i = 0; $i < 100; ++$i) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - - if (53 == $i) { - $output .= "=\r\n"; - } - $output .= 'a'; - } - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals($output, $encoder->encodeString($input, 0, 54)); - } - - public function testBytesBelowPermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(0, 32) as $ordinal) { - $char = chr($ordinal); - - $charStream = $this->createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($char); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([$ordinal]); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertEquals( - sprintf('=%02X', $ordinal), $encoder->encodeString($char) - ); - } - } - - public function testDecimalByte61IsEncoded() - { - /* - According to Rule (1 & 2) - */ - - $char = '='; - - $charStream = $this->createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($char); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([61]); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertEquals('=3D', $encoder->encodeString('=')); - } - - public function testBytesAbovePermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(127, 255) as $ordinal) { - $char = chr($ordinal); - - $charStream = $this->createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($char); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([$ordinal]); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - - $this->assertEquals( - sprintf('=%02X', $ordinal), $encoder->encodeString($char) - ); - } - } - - public function testFirstLineLengthCanBeDifferent() - { - $input = str_repeat('a', 140); - - $charStream = $this->createCharStream(); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($input); - - $output = ''; - for ($i = 0; $i < 140; ++$i) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - - if (53 == $i || 53 + 75 == $i) { - $output .= "=\r\n"; - } - $output .= 'a'; - } - - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn(false); - - $encoder = new Swift_Encoder_QpEncoder($charStream); - $this->assertEquals( - $output, $encoder->encodeString($input, 22), - '%s: First line should start at offset 22 so can only have max length 54' - ); - } - - public function testTextIsPreWrapped() - { - $encoder = $this->createEncoder(); - - $input = str_repeat('a', 70)."\r\n". - str_repeat('a', 70)."\r\n". - str_repeat('a', 70); - - $this->assertEquals( - $input, $encoder->encodeString($input) - ); - } - - private function createCharStream() - { - return $this->getMockery('Swift_CharacterStream')->shouldIgnoreMissing(); - } - - private function createEncoder() - { - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $charStream = new Swift_CharacterStream_NgCharacterStream($factory, 'utf-8'); - - return new Swift_Encoder_QpEncoder($charStream); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php deleted file mode 100644 index 0ab8aa4c4..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Encoder/Rfc2231EncoderTest.php +++ /dev/null @@ -1,141 +0,0 @@ -getMockery('Swift_CharacterStream'); - - $string = ''; - foreach (range(0x00, 0x7F) as $octet) { - $char = pack('C', $octet); - $string .= $char; - $charStream->shouldReceive('read') - ->once() - ->andReturn($char); - } - - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - $charStream->shouldReceive('read') - ->atLeast()->times(1) - ->andReturn(false); - - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - $encoded = $encoder->encodeString($string); - - foreach (explode("\r\n", $encoded) as $line) { - $this->assertRegExp($this->rfc2045Token, $line, - '%s: Encoder should always return a valid RFC 2045 token.'); - } - } - - public function testEncodingNonAsciiCharactersProducesValidToken() - { - $charStream = $this->getMockery('Swift_CharacterStream'); - - $string = ''; - foreach (range(0x80, 0xFF) as $octet) { - $char = pack('C', $octet); - $string .= $char; - $charStream->shouldReceive('read') - ->once() - ->andReturn($char); - } - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - $charStream->shouldReceive('read') - ->atLeast()->times(1) - ->andReturn(false); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - - $encoded = $encoder->encodeString($string); - - foreach (explode("\r\n", $encoded) as $line) { - $this->assertRegExp($this->rfc2045Token, $line, - '%s: Encoder should always return a valid RFC 2045 token.'); - } - } - - public function testMaximumLineLengthCanBeSet() - { - $charStream = $this->getMockery('Swift_CharacterStream'); - - $string = ''; - for ($x = 0; $x < 200; ++$x) { - $char = 'a'; - $string .= $char; - $charStream->shouldReceive('read') - ->once() - ->andReturn($char); - } - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - $charStream->shouldReceive('read') - ->atLeast()->times(1) - ->andReturn(false); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - - $encoded = $encoder->encodeString($string, 0, 75); - - $this->assertEquals( - str_repeat('a', 75)."\r\n". - str_repeat('a', 75)."\r\n". - str_repeat('a', 50), - $encoded, - '%s: Lines should be wrapped at each 75 characters' - ); - } - - public function testFirstLineCanHaveShorterLength() - { - $charStream = $this->getMockery('Swift_CharacterStream'); - - $string = ''; - for ($x = 0; $x < 200; ++$x) { - $char = 'a'; - $string .= $char; - $charStream->shouldReceive('read') - ->once() - ->andReturn($char); - } - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importString') - ->once() - ->with($string); - $charStream->shouldReceive('read') - ->atLeast()->times(1) - ->andReturn(false); - $encoder = new Swift_Encoder_Rfc2231Encoder($charStream); - $encoded = $encoder->encodeString($string, 25, 75); - - $this->assertEquals( - str_repeat('a', 50)."\r\n". - str_repeat('a', 75)."\r\n". - str_repeat('a', 75), - $encoded, - '%s: First line should be 25 bytes shorter than the others.' - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php deleted file mode 100644 index 2915870de..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php +++ /dev/null @@ -1,34 +0,0 @@ -createEvent($this->createTransport(), "FOO\r\n"); - $this->assertEquals("FOO\r\n", $evt->getCommand()); - } - - public function testSuccessCodesCanBeFetchedViaGetter() - { - $evt = $this->createEvent($this->createTransport(), "FOO\r\n", [250]); - $this->assertEquals([250], $evt->getSuccessCodes()); - } - - public function testSourceIsBuffer() - { - $transport = $this->createTransport(); - $evt = $this->createEvent($transport, "FOO\r\n"); - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref); - } - - private function createEvent(Swift_Transport $source, $command, $successCodes = []) - { - return new Swift_Events_CommandEvent($source, $command, $successCodes); - } - - private function createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php deleted file mode 100644 index b67461fad..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php +++ /dev/null @@ -1,32 +0,0 @@ -createEvent($source); - $ref = $evt->getSource(); - $this->assertEquals($source, $ref); - } - - public function testEventDoesNotHaveCancelledBubbleWhenNew() - { - $source = new stdClass(); - $evt = $this->createEvent($source); - $this->assertFalse($evt->bubbleCancelled()); - } - - public function testBubbleCanBeCancelledInEvent() - { - $source = new stdClass(); - $evt = $this->createEvent($source); - $evt->cancelBubble(); - $this->assertTrue($evt->bubbleCancelled()); - } - - private function createEvent($source) - { - return new Swift_Events_EventObject($source); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php deleted file mode 100644 index ba5c191c9..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/ResponseEventTest.php +++ /dev/null @@ -1,38 +0,0 @@ -createEvent($this->createTransport(), "250 Ok\r\n", true); - $this->assertEquals("250 Ok\r\n", $evt->getResponse(), - '%s: Response should be available via getResponse()' - ); - } - - public function testResultCanBeFetchedViaGetter() - { - $evt = $this->createEvent($this->createTransport(), "250 Ok\r\n", false); - $this->assertFalse($evt->isValid(), - '%s: Result should be checkable via isValid()' - ); - } - - public function testSourceIsBuffer() - { - $transport = $this->createTransport(); - $evt = $this->createEvent($transport, "250 Ok\r\n", true); - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref); - } - - private function createEvent(Swift_Transport $source, $response, $result) - { - return new Swift_Events_ResponseEvent($source, $response, $result); - } - - private function createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php deleted file mode 100644 index 9f55589a6..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SendEventTest.php +++ /dev/null @@ -1,96 +0,0 @@ -createMessage(); - $transport = $this->createTransport(); - - $evt = $this->createEvent($transport, $message); - - $ref = $evt->getMessage(); - $this->assertEquals($message, $ref, - '%s: Message should be returned from getMessage()' - ); - } - - public function testTransportCanBeFetchViaGetter() - { - $message = $this->createMessage(); - $transport = $this->createTransport(); - - $evt = $this->createEvent($transport, $message); - - $ref = $evt->getTransport(); - $this->assertEquals($transport, $ref, - '%s: Transport should be returned from getTransport()' - ); - } - - public function testTransportCanBeFetchViaGetSource() - { - $message = $this->createMessage(); - $transport = $this->createTransport(); - - $evt = $this->createEvent($transport, $message); - - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref, - '%s: Transport should be returned from getSource()' - ); - } - - public function testResultCanBeSetAndGet() - { - $message = $this->createMessage(); - $transport = $this->createTransport(); - - $evt = $this->createEvent($transport, $message); - - $evt->setResult( - Swift_Events_SendEvent::RESULT_SUCCESS | Swift_Events_SendEvent::RESULT_TENTATIVE - ); - - $this->assertTrue((bool) ($evt->getResult() & Swift_Events_SendEvent::RESULT_SUCCESS)); - $this->assertTrue((bool) ($evt->getResult() & Swift_Events_SendEvent::RESULT_TENTATIVE)); - } - - public function testFailedRecipientsCanBeSetAndGet() - { - $message = $this->createMessage(); - $transport = $this->createTransport(); - - $evt = $this->createEvent($transport, $message); - - $evt->setFailedRecipients(['foo@bar', 'zip@button']); - - $this->assertEquals(['foo@bar', 'zip@button'], $evt->getFailedRecipients(), - '%s: FailedRecipients should be returned from getter' - ); - } - - public function testFailedRecipientsGetsPickedUpCorrectly() - { - $message = $this->createMessage(); - $transport = $this->createTransport(); - - $evt = $this->createEvent($transport, $message); - $this->assertEquals([], $evt->getFailedRecipients()); - } - - private function createEvent(Swift_Transport $source, Swift_Mime_SimpleMessage $message) - { - return new Swift_Events_SendEvent($source, $message); - } - - private function createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function createMessage() - { - return $this->getMockBuilder('Swift_Mime_SimpleMessage')->disableOriginalConstructor()->getMock(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php deleted file mode 100644 index d5dce2b9b..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/SimpleEventDispatcherTest.php +++ /dev/null @@ -1,142 +0,0 @@ -dispatcher = new Swift_Events_SimpleEventDispatcher(); - } - - public function testSendEventCanBeCreated() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $message = $this->getMockBuilder('Swift_Mime_SimpleMessage')->disableOriginalConstructor()->getMock(); - $evt = $this->dispatcher->createSendEvent($transport, $message); - $this->assertInstanceOf('Swift_Events_SendEvent', $evt); - $this->assertSame($message, $evt->getMessage()); - $this->assertSame($transport, $evt->getTransport()); - } - - public function testCommandEventCanBeCreated() - { - $buf = $this->getMockBuilder('Swift_Transport')->getMock(); - $evt = $this->dispatcher->createCommandEvent($buf, "FOO\r\n", [250]); - $this->assertInstanceOf('Swift_Events_CommandEvent', $evt); - $this->assertSame($buf, $evt->getSource()); - $this->assertEquals("FOO\r\n", $evt->getCommand()); - $this->assertEquals([250], $evt->getSuccessCodes()); - } - - public function testResponseEventCanBeCreated() - { - $buf = $this->getMockBuilder('Swift_Transport')->getMock(); - $evt = $this->dispatcher->createResponseEvent($buf, "250 Ok\r\n", true); - $this->assertInstanceOf('Swift_Events_ResponseEvent', $evt); - $this->assertSame($buf, $evt->getSource()); - $this->assertEquals("250 Ok\r\n", $evt->getResponse()); - $this->assertTrue($evt->isValid()); - } - - public function testTransportChangeEventCanBeCreated() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $evt = $this->dispatcher->createTransportChangeEvent($transport); - $this->assertInstanceOf('Swift_Events_TransportChangeEvent', $evt); - $this->assertSame($transport, $evt->getSource()); - } - - public function testTransportExceptionEventCanBeCreated() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $ex = new Swift_TransportException(''); - $evt = $this->dispatcher->createTransportExceptionEvent($transport, $ex); - $this->assertInstanceOf('Swift_Events_TransportExceptionEvent', $evt); - $this->assertSame($transport, $evt->getSource()); - $this->assertSame($ex, $evt->getException()); - } - - public function testListenersAreNotifiedOfDispatchedEvent() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - - $evt = $this->dispatcher->createTransportChangeEvent($transport); - - $listenerA = $this->getMockBuilder('Swift_Events_TransportChangeListener')->getMock(); - $listenerB = $this->getMockBuilder('Swift_Events_TransportChangeListener')->getMock(); - - $this->dispatcher->bindEventListener($listenerA); - $this->dispatcher->bindEventListener($listenerB); - - $listenerA->expects($this->once()) - ->method('transportStarted') - ->with($evt); - $listenerB->expects($this->once()) - ->method('transportStarted') - ->with($evt); - - $this->dispatcher->dispatchEvent($evt, 'transportStarted'); - } - - public function testListenersAreOnlyCalledIfImplementingCorrectInterface() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $message = $this->getMockBuilder('Swift_Mime_SimpleMessage')->disableOriginalConstructor()->getMock(); - - $evt = $this->dispatcher->createSendEvent($transport, $message); - - $targetListener = $this->getMockBuilder('Swift_Events_SendListener')->getMock(); - $otherListener = $this->getMockBuilder('DummyListener')->getMock(); - - $this->dispatcher->bindEventListener($targetListener); - $this->dispatcher->bindEventListener($otherListener); - - $targetListener->expects($this->once()) - ->method('sendPerformed') - ->with($evt); - $otherListener->expects($this->never()) - ->method('sendPerformed'); - - $this->dispatcher->dispatchEvent($evt, 'sendPerformed'); - } - - public function testListenersCanCancelBubblingOfEvent() - { - $transport = $this->getMockBuilder('Swift_Transport')->getMock(); - $message = $this->getMockBuilder('Swift_Mime_SimpleMessage')->disableOriginalConstructor()->getMock(); - - $evt = $this->dispatcher->createSendEvent($transport, $message); - - $listenerA = $this->getMockBuilder('Swift_Events_SendListener')->getMock(); - $listenerB = $this->getMockBuilder('Swift_Events_SendListener')->getMock(); - - $this->dispatcher->bindEventListener($listenerA); - $this->dispatcher->bindEventListener($listenerB); - - $listenerA->expects($this->once()) - ->method('sendPerformed') - ->with($evt) - ->will($this->returnCallback(function ($object) { - $object->cancelBubble(true); - })); - $listenerB->expects($this->never()) - ->method('sendPerformed'); - - $this->dispatcher->dispatchEvent($evt, 'sendPerformed'); - - $this->assertTrue($evt->bubbleCancelled()); - } - - private function createDispatcher(array $map) - { - return new Swift_Events_SimpleEventDispatcher($map); - } -} - -class DummyListener implements Swift_Events_EventListener -{ - public function sendPerformed(Swift_Events_SendEvent $evt) - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php deleted file mode 100644 index 625b96c9b..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php +++ /dev/null @@ -1,30 +0,0 @@ -createTransport(); - $evt = $this->createEvent($transport); - $ref = $evt->getTransport(); - $this->assertEquals($transport, $ref); - } - - public function testSourceIsTransport() - { - $transport = $this->createTransport(); - $evt = $this->createEvent($transport); - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref); - } - - private function createEvent(Swift_Transport $source) - { - return new Swift_Events_TransportChangeEvent($source); - } - - private function createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php deleted file mode 100644 index 033b0e5b3..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/TransportExceptionEventTest.php +++ /dev/null @@ -1,41 +0,0 @@ -createException(); - $transport = $this->createTransport(); - $evt = $this->createEvent($transport, $ex); - $ref = $evt->getException(); - $this->assertEquals($ex, $ref, - '%s: Exception should be available via getException()' - ); - } - - public function testSourceIsTransport() - { - $ex = $this->createException(); - $transport = $this->createTransport(); - $evt = $this->createEvent($transport, $ex); - $ref = $evt->getSource(); - $this->assertEquals($transport, $ref, - '%s: Transport should be available via getSource()' - ); - } - - private function createEvent(Swift_Transport $transport, Swift_TransportException $ex) - { - return new Swift_Events_TransportExceptionEvent($transport, $ex); - } - - private function createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function createException() - { - return new Swift_TransportException(''); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php deleted file mode 100644 index 129c99e9b..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/ArrayKeyCacheTest.php +++ /dev/null @@ -1,240 +0,0 @@ -createKeyCacheInputStream(); - $cache = $this->createCache($is); - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('test', $cache->getString($this->key1, 'foo')); - } - - public function testStringDataCanBeOverwritten() - { - $is = $this->createKeyCacheInputStream(); - $cache = $this->createCache($is); - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->key1, 'foo', 'whatever', Swift_KeyCache::MODE_WRITE - ); - - $this->assertEquals('whatever', $cache->getString($this->key1, 'foo')); - } - - public function testStringDataCanBeAppended() - { - $is = $this->createKeyCacheInputStream(); - $cache = $this->createCache($is); - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->key1, 'foo', 'ing', Swift_KeyCache::MODE_APPEND - ); - - $this->assertEquals('testing', $cache->getString($this->key1, 'foo')); - } - - public function testHasKeyReturnValue() - { - $is = $this->createKeyCacheInputStream(); - $cache = $this->createCache($is); - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $this->assertTrue($cache->hasKey($this->key1, 'foo')); - } - - public function testNsKeyIsWellPartitioned() - { - $is = $this->createKeyCacheInputStream(); - $cache = $this->createCache($is); - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->key2, 'foo', 'ing', Swift_KeyCache::MODE_WRITE - ); - - $this->assertEquals('test', $cache->getString($this->key1, 'foo')); - $this->assertEquals('ing', $cache->getString($this->key2, 'foo')); - } - - public function testItemKeyIsWellPartitioned() - { - $is = $this->createKeyCacheInputStream(); - $cache = $this->createCache($is); - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->key1, 'bar', 'ing', Swift_KeyCache::MODE_WRITE - ); - - $this->assertEquals('test', $cache->getString($this->key1, 'foo')); - $this->assertEquals('ing', $cache->getString($this->key1, 'bar')); - } - - public function testByteStreamCanBeImported() - { - $os = $this->createOutputStream(); - $os->expects($this->at(0)) - ->method('read') - ->will($this->returnValue('abc')); - $os->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('def')); - $os->expects($this->at(2)) - ->method('read') - ->will($this->returnValue(false)); - - $is = $this->createKeyCacheInputStream(); - $cache = $this->createCache($is); - $cache->importFromByteStream( - $this->key1, 'foo', $os, Swift_KeyCache::MODE_WRITE - ); - $this->assertEquals('abcdef', $cache->getString($this->key1, 'foo')); - } - - public function testByteStreamCanBeAppended() - { - $os1 = $this->createOutputStream(); - $os1->expects($this->at(0)) - ->method('read') - ->will($this->returnValue('abc')); - $os1->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('def')); - $os1->expects($this->at(2)) - ->method('read') - ->will($this->returnValue(false)); - - $os2 = $this->createOutputStream(); - $os2->expects($this->at(0)) - ->method('read') - ->will($this->returnValue('xyz')); - $os2->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('uvw')); - $os2->expects($this->at(2)) - ->method('read') - ->will($this->returnValue(false)); - - $is = $this->createKeyCacheInputStream(true); - - $cache = $this->createCache($is); - - $cache->importFromByteStream( - $this->key1, 'foo', $os1, Swift_KeyCache::MODE_APPEND - ); - $cache->importFromByteStream( - $this->key1, 'foo', $os2, Swift_KeyCache::MODE_APPEND - ); - - $this->assertEquals('abcdefxyzuvw', $cache->getString($this->key1, 'foo')); - } - - public function testByteStreamAndStringCanBeAppended() - { - $os = $this->createOutputStream(); - $os->expects($this->at(0)) - ->method('read') - ->will($this->returnValue('abc')); - $os->expects($this->at(1)) - ->method('read') - ->will($this->returnValue('def')); - $os->expects($this->at(2)) - ->method('read') - ->will($this->returnValue(false)); - - $is = $this->createKeyCacheInputStream(true); - - $cache = $this->createCache($is); - - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_APPEND - ); - $cache->importFromByteStream( - $this->key1, 'foo', $os, Swift_KeyCache::MODE_APPEND - ); - $this->assertEquals('testabcdef', $cache->getString($this->key1, 'foo')); - } - - public function testDataCanBeExportedToByteStream() - { - //See acceptance test for more detail - $is = $this->createInputStream(); - $is->expects($this->atLeastOnce()) - ->method('write'); - - $kcis = $this->createKeyCacheInputStream(true); - - $cache = $this->createCache($kcis); - - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - - $cache->exportToByteStream($this->key1, 'foo', $is); - } - - public function testKeyCanBeCleared() - { - $is = $this->createKeyCacheInputStream(); - $cache = $this->createCache($is); - - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($cache->hasKey($this->key1, 'foo')); - $cache->clearKey($this->key1, 'foo'); - $this->assertFalse($cache->hasKey($this->key1, 'foo')); - } - - public function testNsKeyCanBeCleared() - { - $is = $this->createKeyCacheInputStream(); - $cache = $this->createCache($is); - - $cache->setString( - $this->key1, 'foo', 'test', Swift_KeyCache::MODE_WRITE - ); - $cache->setString( - $this->key1, 'bar', 'xyz', Swift_KeyCache::MODE_WRITE - ); - $this->assertTrue($cache->hasKey($this->key1, 'foo')); - $this->assertTrue($cache->hasKey($this->key1, 'bar')); - $cache->clearAll($this->key1); - $this->assertFalse($cache->hasKey($this->key1, 'foo')); - $this->assertFalse($cache->hasKey($this->key1, 'bar')); - } - - private function createCache($is) - { - return new Swift_KeyCache_ArrayKeyCache($is); - } - - private function createKeyCacheInputStream() - { - return $this->getMockBuilder('Swift_KeyCache_KeyCacheInputStream')->getMock(); - } - - private function createOutputStream() - { - return $this->getMockBuilder('Swift_OutputByteStream')->getMock(); - } - - private function createInputStream() - { - return $this->getMockBuilder('Swift_InputByteStream')->getMock(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php deleted file mode 100644 index 4274aafd5..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/KeyCache/SimpleKeyCacheInputStreamTest.php +++ /dev/null @@ -1,73 +0,0 @@ -getMockBuilder('Swift_KeyCache')->getMock(); - $cache->expects($this->at(0)) - ->method('setString') - ->with($this->nsKey, 'foo', 'a', Swift_KeyCache::MODE_APPEND); - $cache->expects($this->at(1)) - ->method('setString') - ->with($this->nsKey, 'foo', 'b', Swift_KeyCache::MODE_APPEND); - $cache->expects($this->at(2)) - ->method('setString') - ->with($this->nsKey, 'foo', 'c', Swift_KeyCache::MODE_APPEND); - - $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); - $stream->setKeyCache($cache); - $stream->setNsKey($this->nsKey); - $stream->setItemKey('foo'); - - $stream->write('a'); - $stream->write('b'); - $stream->write('c'); - } - - public function testFlushContentClearsKey() - { - $cache = $this->getMockBuilder('Swift_KeyCache')->getMock(); - $cache->expects($this->once()) - ->method('clearKey') - ->with($this->nsKey, 'foo'); - - $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); - $stream->setKeyCache($cache); - $stream->setNsKey($this->nsKey); - $stream->setItemKey('foo'); - - $stream->flushBuffers(); - } - - public function testClonedStreamStillReferencesSameCache() - { - $cache = $this->getMockBuilder('Swift_KeyCache')->getMock(); - $cache->expects($this->at(0)) - ->method('setString') - ->with($this->nsKey, 'foo', 'a', Swift_KeyCache::MODE_APPEND); - $cache->expects($this->at(1)) - ->method('setString') - ->with($this->nsKey, 'foo', 'b', Swift_KeyCache::MODE_APPEND); - $cache->expects($this->at(2)) - ->method('setString') - ->with('test', 'bar', 'x', Swift_KeyCache::MODE_APPEND); - - $stream = new Swift_KeyCache_SimpleKeyCacheInputStream(); - $stream->setKeyCache($cache); - $stream->setNsKey($this->nsKey); - $stream->setItemKey('foo'); - - $stream->write('a'); - $stream->write('b'); - - $newStream = clone $stream; - $newStream->setKeyCache($cache); - $newStream->setNsKey('test'); - $newStream->setItemKey('bar'); - - $newStream->write('x'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php deleted file mode 100644 index 12506ddfb..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mailer/ArrayRecipientIteratorTest.php +++ /dev/null @@ -1,42 +0,0 @@ -assertFalse($it->hasNext()); - } - - public function testHasNextReturnsTrueIfItemsLeft() - { - $it = new Swift_Mailer_ArrayRecipientIterator(['foo@bar' => 'Foo']); - $this->assertTrue($it->hasNext()); - } - - public function testReadingToEndOfListCausesHasNextToReturnFalse() - { - $it = new Swift_Mailer_ArrayRecipientIterator(['foo@bar' => 'Foo']); - $this->assertTrue($it->hasNext()); - $it->nextRecipient(); - $this->assertFalse($it->hasNext()); - } - - public function testReturnedValueHasPreservedKeyValuePair() - { - $it = new Swift_Mailer_ArrayRecipientIterator(['foo@bar' => 'Foo']); - $this->assertEquals(['foo@bar' => 'Foo'], $it->nextRecipient()); - } - - public function testIteratorMovesNextAfterEachIteration() - { - $it = new Swift_Mailer_ArrayRecipientIterator([ - 'foo@bar' => 'Foo', - 'zip@button' => 'Zip thing', - 'test@test' => null, - ]); - $this->assertEquals(['foo@bar' => 'Foo'], $it->nextRecipient()); - $this->assertEquals(['zip@button' => 'Zip thing'], $it->nextRecipient()); - $this->assertEquals(['test@test' => null], $it->nextRecipient()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php deleted file mode 100644 index a2a96d0f9..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MailerTest.php +++ /dev/null @@ -1,145 +0,0 @@ -createTransport(); - $message = $this->createMessage(); - - $started = false; - $transport->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$started) { - return $started; - }); - $transport->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$started) { - $started = true; - - return; - }); - - $mailer = $this->createMailer($transport); - $mailer->send($message); - } - - public function testTransportIsOnlyStartedOnce() - { - $transport = $this->createTransport(); - $message = $this->createMessage(); - - $started = false; - $transport->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$started) { - return $started; - }); - $transport->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$started) { - $started = true; - - return; - }); - - $mailer = $this->createMailer($transport); - for ($i = 0; $i < 10; ++$i) { - $mailer->send($message); - } - } - - public function testMessageIsPassedToTransport() - { - $transport = $this->createTransport(); - $message = $this->createMessage(); - $transport->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()); - - $mailer = $this->createMailer($transport); - $mailer->send($message); - } - - public function testSendReturnsCountFromTransport() - { - $transport = $this->createTransport(); - $message = $this->createMessage(); - $transport->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturn(57); - - $mailer = $this->createMailer($transport); - $this->assertEquals(57, $mailer->send($message)); - } - - public function testFailedRecipientReferenceIsPassedToTransport() - { - $failures = []; - - $transport = $this->createTransport(); - $message = $this->createMessage(); - $transport->shouldReceive('send') - ->once() - ->with($message, $failures) - ->andReturn(57); - - $mailer = $this->createMailer($transport); - $mailer->send($message, $failures); - } - - public function testSendRecordsRfcComplianceExceptionAsEntireSendFailure() - { - $failures = []; - - $rfcException = new Swift_RfcComplianceException('test'); - $transport = $this->createTransport(); - $message = $this->createMessage(); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo&invalid' => 'Foo', 'bar@valid.tld' => 'Bar']); - $transport->shouldReceive('send') - ->once() - ->with($message, $failures) - ->andThrow($rfcException); - - $mailer = $this->createMailer($transport); - $this->assertEquals(0, $mailer->send($message, $failures), '%s: Should return 0'); - $this->assertEquals(['foo&invalid', 'bar@valid.tld'], $failures, '%s: Failures should contain all addresses since the entire message failed to compile'); - } - - public function testRegisterPluginDelegatesToTransport() - { - $plugin = $this->createPlugin(); - $transport = $this->createTransport(); - $mailer = $this->createMailer($transport); - - $transport->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - - $mailer->registerPlugin($plugin); - } - - private function createPlugin() - { - return $this->getMockery('Swift_Events_EventListener')->shouldIgnoreMissing(); - } - - private function createTransport() - { - return $this->getMockery('Swift_Transport')->shouldIgnoreMissing(); - } - - private function createMessage() - { - return $this->getMockery('Swift_Mime_SimpleMessage')->shouldIgnoreMissing(); - } - - private function createMailer(Swift_Transport $transport) - { - return new Swift_Mailer($transport); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MessageTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MessageTest.php deleted file mode 100644 index 3ebbd7ea2..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/MessageTest.php +++ /dev/null @@ -1,133 +0,0 @@ -recursiveObjectCloningCheck($message1, $message2, $message1_clone); - // the test above will fail if the two messages are not identical - $this->addToAssertionCount(1); - } - - public function testCloningWithSigners() - { - $message1 = new Swift_Message('subj', 'body', 'ctype'); - $signer = new Swift_Signers_DKIMSigner(dirname(dirname(__DIR__)).'/_samples/dkim/dkim.test.priv', 'test.example', 'example'); - $message1->attachSigner($signer); - $message2 = new Swift_Message('subj', 'body', 'ctype'); - $signer = new Swift_Signers_DKIMSigner(dirname(dirname(__DIR__)).'/_samples/dkim/dkim.test.priv', 'test.example', 'example'); - $message2->attachSigner($signer); - $message1_clone = clone $message1; - - $this->recursiveObjectCloningCheck($message1, $message2, $message1_clone); - // the test above will fail if the two messages are not identical - $this->addToAssertionCount(1); - } - - public function testBodySwap() - { - $message1 = new Swift_Message('Test'); - $html = new Swift_MimePart('', 'text/html'); - $html->getHeaders()->addTextHeader('X-Test-Remove', 'Test-Value'); - $html->getHeaders()->addTextHeader('X-Test-Alter', 'Test-Value'); - $message1->attach($html); - $source = $message1->toString(); - $message2 = clone $message1; - $message2->setSubject('Message2'); - foreach ($message2->getChildren() as $child) { - $child->setBody('Test'); - $child->getHeaders()->removeAll('X-Test-Remove'); - $child->getHeaders()->get('X-Test-Alter')->setValue('Altered'); - } - $final = $message1->toString(); - if ($source != $final) { - $this->fail("Difference although object cloned \n [".$source."]\n[".$final."]\n"); - } - $final = $message2->toString(); - if ($final == $source) { - $this->fail('Two body matches although they should differ'."\n [".$source."]\n[".$final."]\n"); - } - $id_1 = $message1->getId(); - $id_2 = $message2->getId(); - $this->assertEquals($id_1, $id_2, 'Message Ids differ'); - $id_2 = $message2->generateId(); - $this->assertNotEquals($id_1, $id_2, 'Message Ids are the same'); - } - - protected function recursiveObjectCloningCheck($obj1, $obj2, $obj1_clone) - { - $obj1_properties = (array) $obj1; - $obj2_properties = (array) $obj2; - $obj1_clone_properties = (array) $obj1_clone; - - foreach ($obj1_properties as $property => $value) { - if (is_object($value)) { - $obj1_value = $obj1_properties[$property]; - $obj2_value = $obj2_properties[$property]; - $obj1_clone_value = $obj1_clone_properties[$property]; - - if ($obj1_value !== $obj2_value) { - // two separetely instanciated objects property not referencing same object - $this->assertFalse( - // but object's clone does - not everything copied - $obj1_value === $obj1_clone_value, - "Property `$property` cloning error: source and cloned objects property is referencing same object" - ); - } else { - // two separetely instanciated objects have same reference - $this->assertFalse( - // but object's clone doesn't - overdone making copies - $obj1_value !== $obj1_clone_value, - "Property `$property` not properly cloned: it should reference same object as cloning source (overdone copping)" - ); - } - // recurse - $this->recursiveObjectCloningCheck($obj1_value, $obj2_value, $obj1_clone_value); - } elseif (is_array($value)) { - $obj1_value = $obj1_properties[$property]; - $obj2_value = $obj2_properties[$property]; - $obj1_clone_value = $obj1_clone_properties[$property]; - - return $this->recursiveArrayCloningCheck($obj1_value, $obj2_value, $obj1_clone_value); - } - } - } - - protected function recursiveArrayCloningCheck($array1, $array2, $array1_clone) - { - foreach ($array1 as $key => $value) { - if (is_object($value)) { - $arr1_value = $array1[$key]; - $arr2_value = $array2[$key]; - $arr1_clone_value = $array1_clone[$key]; - if ($arr1_value !== $arr2_value) { - // two separetely instanciated objects property not referencing same object - $this->assertFalse( - // but object's clone does - not everything copied - $arr1_value === $arr1_clone_value, - "Key `$key` cloning error: source and cloned objects property is referencing same object" - ); - } else { - // two separetely instanciated objects have same reference - $this->assertFalse( - // but object's clone doesn't - overdone making copies - $arr1_value !== $arr1_clone_value, - "Key `$key` not properly cloned: it should reference same object as cloning source (overdone copping)" - ); - } - // recurse - $this->recursiveObjectCloningCheck($arr1_value, $arr2_value, $arr1_clone_value); - } elseif (is_array($value)) { - $arr1_value = $array1[$key]; - $arr2_value = $array2[$key]; - $arr1_clone_value = $array1_clone[$key]; - - return $this->recursiveArrayCloningCheck($arr1_value, $arr2_value, $arr1_clone_value); - } - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php deleted file mode 100644 index c7c2c03d1..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AbstractMimeEntityTest.php +++ /dev/null @@ -1,1092 +0,0 @@ -createHeaderSet(); - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $this->assertSame($headers, $entity->getHeaders()); - } - - public function testContentTypeIsReturnedFromHeader() - { - $ctype = $this->createHeader('Content-Type', 'image/jpeg-test'); - $headers = $this->createHeaderSet(['Content-Type' => $ctype]); - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $this->assertEquals('image/jpeg-test', $entity->getContentType()); - } - - public function testContentTypeIsSetInHeader() - { - $ctype = $this->createHeader('Content-Type', 'text/plain', [], false); - $headers = $this->createHeaderSet(['Content-Type' => $ctype]); - - $ctype->shouldReceive('setFieldBodyModel') - ->once() - ->with('image/jpeg'); - $ctype->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes() - ->with(\Mockery::not('image/jpeg')); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setContentType('image/jpeg'); - } - - public function testContentTypeHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Type', 'image/jpeg'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setContentType('image/jpeg'); - } - - public function testContentTypeCanBeSetViaSetBody() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Type', 'text/html'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setBody('foo', 'text/html'); - } - - public function testGetEncoderFromConstructor() - { - $encoder = $this->createEncoder('base64'); - $entity = $this->createEntity($this->createHeaderSet(), $encoder, - $this->createCache() - ); - $this->assertSame($encoder, $entity->getEncoder()); - } - - public function testSetAndGetEncoder() - { - $encoder = $this->createEncoder('base64'); - $headers = $this->createHeaderSet(); - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setEncoder($encoder); - $this->assertSame($encoder, $entity->getEncoder()); - } - - public function testSettingEncoderUpdatesTransferEncoding() - { - $encoder = $this->createEncoder('base64'); - $encoding = $this->createHeader( - 'Content-Transfer-Encoding', '8bit', [], false - ); - $headers = $this->createHeaderSet([ - 'Content-Transfer-Encoding' => $encoding, - ]); - $encoding->shouldReceive('setFieldBodyModel') - ->once() - ->with('base64'); - $encoding->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setEncoder($encoder); - } - - public function testSettingEncoderAddsEncodingHeaderIfNonePresent() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addTextHeader') - ->once() - ->with('Content-Transfer-Encoding', 'something'); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setEncoder($this->createEncoder('something')); - } - - public function testIdIsReturnedFromHeader() - { - /* -- RFC 2045, 7. - In constructing a high-level user agent, it may be desirable to allow - one body to make reference to another. Accordingly, bodies may be - labelled using the "Content-ID" header field, which is syntactically - identical to the "Message-ID" header field - */ - - $cid = $this->createHeader('Content-ID', 'zip@button'); - $headers = $this->createHeaderSet(['Content-ID' => $cid]); - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $this->assertEquals('zip@button', $entity->getId()); - } - - public function testIdIsSetInHeader() - { - $cid = $this->createHeader('Content-ID', 'zip@button', [], false); - $headers = $this->createHeaderSet(['Content-ID' => $cid]); - - $cid->shouldReceive('setFieldBodyModel') - ->once() - ->with('foo@bar'); - $cid->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setId('foo@bar'); - } - - public function testIdIsAutoGenerated() - { - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $this->assertRegExp('/^.*?@.*?$/D', $entity->getId()); - } - - public function testGenerateIdCreatesNewId() - { - $headers = $this->createHeaderSet(); - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $id1 = $entity->generateId(); - $id2 = $entity->generateId(); - $this->assertNotEquals($id1, $id2); - } - - public function testGenerateIdSetsNewId() - { - $headers = $this->createHeaderSet(); - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $id = $entity->generateId(); - $this->assertEquals($id, $entity->getId()); - } - - public function testDescriptionIsReadFromHeader() - { - /* -- RFC 2045, 8. - The ability to associate some descriptive information with a given - body is often desirable. For example, it may be useful to mark an - "image" body as "a picture of the Space Shuttle Endeavor." Such text - may be placed in the Content-Description header field. This header - field is always optional. - */ - - $desc = $this->createHeader('Content-Description', 'something'); - $headers = $this->createHeaderSet(['Content-Description' => $desc]); - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $this->assertEquals('something', $entity->getDescription()); - } - - public function testDescriptionIsSetInHeader() - { - $desc = $this->createHeader('Content-Description', '', [], false); - $desc->shouldReceive('setFieldBodyModel')->once()->with('whatever'); - - $headers = $this->createHeaderSet(['Content-Description' => $desc]); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setDescription('whatever'); - } - - public function testDescriptionHeaderIsAddedIfNotPresent() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addTextHeader') - ->once() - ->with('Content-Description', 'whatever'); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setDescription('whatever'); - } - - public function testSetAndGetMaxLineLength() - { - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $entity->setMaxLineLength(60); - $this->assertEquals(60, $entity->getMaxLineLength()); - } - - public function testEncoderIsUsedForStringGeneration() - { - $encoder = $this->createEncoder('base64', false); - $encoder->expects($this->once()) - ->method('encodeString') - ->with('blah'); - - $entity = $this->createEntity($this->createHeaderSet(), - $encoder, $this->createCache() - ); - $entity->setBody('blah'); - $entity->toString(); - } - - public function testMaxLineLengthIsProvidedWhenEncoding() - { - $encoder = $this->createEncoder('base64', false); - $encoder->expects($this->once()) - ->method('encodeString') - ->with('blah', 0, 65); - - $entity = $this->createEntity($this->createHeaderSet(), - $encoder, $this->createCache() - ); - $entity->setBody('blah'); - $entity->setMaxLineLength(65); - $entity->toString(); - } - - public function testHeadersAppearInString() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->once() - ->andReturn( - "Content-Type: text/plain; charset=utf-8\r\n". - "X-MyHeader: foobar\r\n" - ); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $this->assertEquals( - "Content-Type: text/plain; charset=utf-8\r\n". - "X-MyHeader: foobar\r\n", - $entity->toString() - ); - } - - public function testSetAndGetBody() - { - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $entity->setBody("blah\r\nblah!"); - $this->assertEquals("blah\r\nblah!", $entity->getBody()); - } - - public function testBodyIsAppended() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->once() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setBody("blah\r\nblah!"); - $this->assertEquals( - "Content-Type: text/plain; charset=utf-8\r\n". - "\r\n". - "blah\r\nblah!", - $entity->toString() - ); - } - - public function testGetBodyReturnsStringFromByteStream() - { - $os = $this->createOutputStream('byte stream string'); - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $entity->setBody($os); - $this->assertEquals('byte stream string', $entity->getBody()); - } - - public function testByteStreamBodyIsAppended() - { - $headers = $this->createHeaderSet([], false); - $os = $this->createOutputStream('streamed'); - $headers->shouldReceive('toString') - ->once() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setBody($os); - $this->assertEquals( - "Content-Type: text/plain; charset=utf-8\r\n". - "\r\n". - 'streamed', - $entity->toString() - ); - } - - public function testBoundaryCanBeRetrieved() - { - /* -- RFC 2046, 5.1.1. - boundary := 0*69 bcharsnospace - - bchars := bcharsnospace / " " - - bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / - "+" / "_" / "," / "-" / "." / - "/" / ":" / "=" / "?" - */ - - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $this->assertRegExp( - '/^[a-zA-Z0-9\'\(\)\+_\-,\.\/:=\?\ ]{0,69}[a-zA-Z0-9\'\(\)\+_\-,\.\/:=\?]$/D', - $entity->getBoundary() - ); - } - - public function testBoundaryNeverChanges() - { - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $firstBoundary = $entity->getBoundary(); - for ($i = 0; $i < 10; ++$i) { - $this->assertEquals($firstBoundary, $entity->getBoundary()); - } - } - - public function testBoundaryCanBeSet() - { - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $entity->setBoundary('foobar'); - $this->assertEquals('foobar', $entity->getBoundary()); - } - - public function testAddingChildrenGeneratesBoundaryInHeaders() - { - $child = $this->createChild(); - $cType = $this->createHeader('Content-Type', 'text/plain', [], false); - $cType->shouldReceive('setParameter') - ->once() - ->with('boundary', \Mockery::any()); - $cType->shouldReceive('setParameter') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($this->createHeaderSet([ - 'Content-Type' => $cType, - ]), - $this->createEncoder(), $this->createCache() - ); - $entity->setChildren([$child]); - } - - public function testChildrenOfLevelAttachmentAndLessCauseMultipartMixed() - { - for ($level = Swift_Mime_SimpleMimeEntity::LEVEL_MIXED; - $level > Swift_Mime_SimpleMimeEntity::LEVEL_TOP; $level /= 2) { - $child = $this->createChild($level); - $cType = $this->createHeader( - 'Content-Type', 'text/plain', [], false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('multipart/mixed'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $entity->setChildren([$child]); - } - } - - public function testChildrenOfLevelAlternativeAndLessCauseMultipartAlternative() - { - for ($level = Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE; - $level > Swift_Mime_SimpleMimeEntity::LEVEL_MIXED; $level /= 2) { - $child = $this->createChild($level); - $cType = $this->createHeader( - 'Content-Type', 'text/plain', [], false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('multipart/alternative'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $entity->setChildren([$child]); - } - } - - public function testChildrenOfLevelRelatedAndLessCauseMultipartRelated() - { - for ($level = Swift_Mime_SimpleMimeEntity::LEVEL_RELATED; - $level > Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE; $level /= 2) { - $child = $this->createChild($level); - $cType = $this->createHeader( - 'Content-Type', 'text/plain', [], false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('multipart/related'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $entity = $this->createEntity($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $entity->setChildren([$child]); - } - } - - public function testHighestLevelChildDeterminesContentType() - { - $combinations = [ - ['levels' => [Swift_Mime_SimpleMimeEntity::LEVEL_MIXED, - Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - Swift_Mime_SimpleMimeEntity::LEVEL_RELATED, - ], - 'type' => 'multipart/mixed', - ], - ['levels' => [Swift_Mime_SimpleMimeEntity::LEVEL_MIXED, - Swift_Mime_SimpleMimeEntity::LEVEL_RELATED, - ], - 'type' => 'multipart/mixed', - ], - ['levels' => [Swift_Mime_SimpleMimeEntity::LEVEL_MIXED, - Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - ], - 'type' => 'multipart/mixed', - ], - ['levels' => [Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - Swift_Mime_SimpleMimeEntity::LEVEL_RELATED, - ], - 'type' => 'multipart/alternative', - ], - ]; - - foreach ($combinations as $combination) { - $children = []; - foreach ($combination['levels'] as $level) { - $children[] = $this->createChild($level); - } - - $cType = $this->createHeader( - 'Content-Type', 'text/plain', [], false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with($combination['type']); - - $headerSet = $this->createHeaderSet(['Content-Type' => $cType]); - $headerSet->shouldReceive('newInstance') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use ($headerSet) { - return $headerSet; - }); - $entity = $this->createEntity($headerSet, - $this->createEncoder(), $this->createCache() - ); - $entity->setChildren($children); - } - } - - public function testChildrenAppearNestedInString() - { - /* -- RFC 2046, 5.1.1. - (excerpt too verbose to paste here) - */ - - $headers = $this->createHeaderSet([], false); - - $child1 = new MimeEntityFixture(Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'foobar', 'text/plain' - ); - - $child2 = new MimeEntityFixture(Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/html\r\n". - "\r\n". - 'foobar', 'text/html' - ); - - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/alternative; boundary=\"xxx\"\r\n"); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren([$child1, $child2]); - - $this->assertEquals( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n". - "\r\n". - "\r\n--xxx\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - "foobar\r\n". - "\r\n--xxx\r\n". - "Content-Type: text/html\r\n". - "\r\n". - "foobar\r\n". - "\r\n--xxx--\r\n", - $entity->toString() - ); - } - - public function testMixingLevelsIsHierarchical() - { - $headers = $this->createHeaderSet([], false); - $newHeaders = $this->createHeaderSet([], false); - - $part = $this->createChild(Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'foobar' - ); - - $attachment = $this->createChild(Swift_Mime_SimpleMimeEntity::LEVEL_MIXED, - "Content-Type: application/octet-stream\r\n". - "\r\n". - 'data' - ); - - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/mixed; boundary=\"xxx\"\r\n"); - $headers->shouldReceive('newInstance') - ->zeroOrMoreTimes() - ->andReturn($newHeaders); - $newHeaders->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/alternative; boundary=\"yyy\"\r\n"); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren([$part, $attachment]); - - $this->assertRegExp( - '~^'. - "Content-Type: multipart/mixed; boundary=\"xxx\"\r\n". - "\r\n\r\n--xxx\r\n". - "Content-Type: multipart/alternative; boundary=\"yyy\"\r\n". - "\r\n\r\n--(.*?)\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - 'foobar'. - "\r\n\r\n--\\1--\r\n". - "\r\n\r\n--xxx\r\n". - "Content-Type: application/octet-stream\r\n". - "\r\n". - 'data'. - "\r\n\r\n--xxx--\r\n". - '$~', - $entity->toString() - ); - } - - public function testSettingEncoderNotifiesChildren() - { - $child = $this->createChild(0, '', false); - $encoder = $this->createEncoder('base64'); - - $child->shouldReceive('encoderChanged') - ->once() - ->with($encoder); - - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $entity->setChildren([$child]); - $entity->setEncoder($encoder); - } - - public function testReceiptOfEncoderChangeNotifiesChildren() - { - $child = $this->createChild(0, '', false); - $encoder = $this->createEncoder('base64'); - - $child->shouldReceive('encoderChanged') - ->once() - ->with($encoder); - - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $entity->setChildren([$child]); - $entity->encoderChanged($encoder); - } - - public function testReceiptOfCharsetChangeNotifiesChildren() - { - $child = $this->createChild(0, '', false); - $child->shouldReceive('charsetChanged') - ->once() - ->with('windows-874'); - - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $entity->setChildren([$child]); - $entity->charsetChanged('windows-874'); - } - - public function testEntityIsWrittenToByteStream() - { - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $is = $this->createInputStream(false); - $is->expects($this->atLeastOnce()) - ->method('write'); - - $entity->toByteStream($is); - } - - public function testEntityHeadersAreComittedToByteStream() - { - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $is = $this->createInputStream(false); - $is->expects($this->atLeastOnce()) - ->method('write'); - $is->expects($this->atLeastOnce()) - ->method('commit'); - - $entity->toByteStream($is); - } - - public function testOrderingTextBeforeHtml() - { - $htmlChild = new MimeEntityFixture(Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/html\r\n". - "\r\n". - 'HTML PART', - 'text/html' - ); - $textChild = new MimeEntityFixture(Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'TEXT PART', - 'text/plain' - ); - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/alternative; boundary=\"xxx\"\r\n"); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren([$htmlChild, $textChild]); - - $this->assertEquals( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n". - "\r\n\r\n--xxx\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - 'TEXT PART'. - "\r\n\r\n--xxx\r\n". - "Content-Type: text/html\r\n". - "\r\n". - 'HTML PART'. - "\r\n\r\n--xxx--\r\n", - $entity->toString() - ); - } - - public function testOrderingEqualContentTypesMaintainsOriginalOrdering() - { - $firstChild = new MimeEntityFixture(Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'PART 1', - 'text/plain' - ); - $secondChild = new MimeEntityFixture(Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, - "Content-Type: text/plain\r\n". - "\r\n". - 'PART 2', - 'text/plain' - ); - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: multipart/alternative; boundary=\"xxx\"\r\n"); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $this->createCache() - ); - $entity->setBoundary('xxx'); - $entity->setChildren([$firstChild, $secondChild]); - - $this->assertEquals( - "Content-Type: multipart/alternative; boundary=\"xxx\"\r\n". - "\r\n\r\n--xxx\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - 'PART 1'. - "\r\n\r\n--xxx\r\n". - "Content-Type: text/plain\r\n". - "\r\n". - 'PART 2'. - "\r\n\r\n--xxx--\r\n", - $entity->toString() - ); - } - - public function testUnsettingChildrenRestoresContentType() - { - $cType = $this->createHeader('Content-Type', 'text/plain', [], false); - $child = $this->createChild(Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE); - - $cType->shouldReceive('setFieldBodyModel') - ->twice() - ->with('image/jpeg'); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('multipart/alternative'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes() - ->with(\Mockery::not('multipart/alternative', 'image/jpeg')); - - $entity = $this->createEntity($this->createHeaderSet([ - 'Content-Type' => $cType, - ]), - $this->createEncoder(), $this->createCache() - ); - - $entity->setContentType('image/jpeg'); - $entity->setChildren([$child]); - $entity->setChildren([]); - } - - public function testBodyIsReadFromCacheWhenUsingToStringIfPresent() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->createCache(false); - $cache->shouldReceive('hasKey') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn(true); - $cache->shouldReceive('getString') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn("\r\ncache\r\ncache!"); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $this->assertEquals( - "Content-Type: text/plain; charset=utf-8\r\n". - "\r\n". - "cache\r\ncache!", - $entity->toString() - ); - } - - public function testBodyIsAddedToCacheWhenUsingToString() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->createCache(false); - $cache->shouldReceive('hasKey') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn(false); - $cache->shouldReceive('setString') - ->once() - ->with(\Mockery::any(), 'body', "\r\nblah\r\nblah!", Swift_KeyCache::MODE_WRITE); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - } - - public function testBodyIsClearedFromCacheIfNewBodySet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->createCache(false); - $entity = $this->createEntity($headers, $this->createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - // We set the expectation at this point because we only care what happens when calling setBody() - $cache->shouldReceive('clearKey') - ->once() - ->with(\Mockery::any(), 'body'); - - $entity->setBody("new\r\nnew!"); - } - - public function testBodyIsNotClearedFromCacheIfSameBodySet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->createCache(false); - $entity = $this->createEntity($headers, $this->createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - // We set the expectation at this point because we only care what happens when calling setBody() - $cache->shouldReceive('clearKey') - ->never(); - - $entity->setBody("blah\r\nblah!"); - } - - public function testBodyIsClearedFromCacheIfNewEncoderSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->createCache(false); - $otherEncoder = $this->createEncoder(); - $entity = $this->createEntity($headers, $this->createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - // We set the expectation at this point because we only care what happens when calling setEncoder() - $cache->shouldReceive('clearKey') - ->once() - ->with(\Mockery::any(), 'body'); - - $entity->setEncoder($otherEncoder); - } - - public function testBodyIsReadFromCacheWhenUsingToByteStreamIfPresent() - { - $is = $this->createInputStream(); - $cache = $this->createCache(false); - $cache->shouldReceive('hasKey') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn(true); - $cache->shouldReceive('exportToByteStream') - ->once() - ->with(\Mockery::any(), 'body', $is); - - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $cache - ); - $entity->setBody('foo'); - - $entity->toByteStream($is); - } - - public function testBodyIsAddedToCacheWhenUsingToByteStream() - { - $is = $this->createInputStream(); - $cache = $this->createCache(false); - $cache->shouldReceive('hasKey') - ->once() - ->with(\Mockery::any(), 'body') - ->andReturn(false); - $cache->shouldReceive('getInputByteStream') - ->once() - ->with(\Mockery::any(), 'body'); - - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $cache - ); - $entity->setBody('foo'); - - $entity->toByteStream($is); - } - - public function testFluidInterface() - { - $entity = $this->createEntity($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - - $this->assertSame($entity, - $entity - ->setContentType('text/plain') - ->setEncoder($this->createEncoder()) - ->setId('foo@bar') - ->setDescription('my description') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren([]) - ); - } - - abstract protected function createEntity($headers, $encoder, $cache); - - protected function createChild($level = null, $string = '', $stub = true) - { - $child = $this->getMockery('Swift_Mime_SimpleMimeEntity')->shouldIgnoreMissing(); - if (isset($level)) { - $child->shouldReceive('getNestingLevel') - ->zeroOrMoreTimes() - ->andReturn($level); - } - $child->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn($string); - - return $child; - } - - protected function createEncoder($name = 'quoted-printable', $stub = true) - { - $encoder = $this->getMockBuilder('Swift_Mime_ContentEncoder')->getMock(); - $encoder->expects($this->any()) - ->method('getName') - ->will($this->returnValue($name)); - $encoder->expects($this->any()) - ->method('encodeString') - ->will($this->returnCallback(function () { - $args = func_get_args(); - - return array_shift($args); - })); - - return $encoder; - } - - protected function createCache($stub = true) - { - return $this->getMockery('Swift_KeyCache')->shouldIgnoreMissing(); - } - - protected function createHeaderSet($headers = [], $stub = true) - { - $set = $this->getMockery('Swift_Mime_SimpleHeaderSet')->shouldIgnoreMissing(); - $set->shouldReceive('get') - ->zeroOrMoreTimes() - ->andReturnUsing(function ($key) use ($headers) { - return $headers[$key]; - }); - $set->shouldReceive('has') - ->zeroOrMoreTimes() - ->andReturnUsing(function ($key) use ($headers) { - return array_key_exists($key, $headers); - }); - - return $set; - } - - protected function createHeader($name, $model = null, $params = [], $stub = true) - { - $header = $this->getMockery('Swift_Mime_Headers_ParameterizedHeader')->shouldIgnoreMissing(); - $header->shouldReceive('getFieldName') - ->zeroOrMoreTimes() - ->andReturn($name); - $header->shouldReceive('getFieldBodyModel') - ->zeroOrMoreTimes() - ->andReturn($model); - $header->shouldReceive('getParameter') - ->zeroOrMoreTimes() - ->andReturnUsing(function ($key) use ($params) { - return $params[$key]; - }); - - return $header; - } - - protected function createOutputStream($data = null, $stub = true) - { - $os = $this->getMockery('Swift_OutputByteStream'); - if (isset($data)) { - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use ($data) { - static $first = true; - if (!$first) { - return false; - } - - $first = false; - - return $data; - }); - $os->shouldReceive('setReadPointer') - ->zeroOrMoreTimes(); - } - - return $os; - } - - protected function createInputStream($stub = true) - { - return $this->getMockBuilder('Swift_InputByteStream')->getMock(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php deleted file mode 100644 index 912d529c7..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/AttachmentTest.php +++ /dev/null @@ -1,321 +0,0 @@ -createAttachment($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals( - Swift_Mime_SimpleMimeEntity::LEVEL_MIXED, $attachment->getNestingLevel() - ); - } - - public function testDispositionIsReturnedFromHeader() - { - /* -- RFC 2183, 2.1, 2.2. - */ - - $disposition = $this->createHeader('Content-Disposition', 'attachment'); - $attachment = $this->createAttachment($this->createHeaderSet([ - 'Content-Disposition' => $disposition, ]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals('attachment', $attachment->getDisposition()); - } - - public function testDispositionIsSetInHeader() - { - $disposition = $this->createHeader('Content-Disposition', 'attachment', - [], false - ); - $disposition->shouldReceive('setFieldBodyModel') - ->once() - ->with('inline'); - $disposition->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $attachment = $this->createAttachment($this->createHeaderSet([ - 'Content-Disposition' => $disposition, ]), - $this->createEncoder(), $this->createCache() - ); - $attachment->setDisposition('inline'); - } - - public function testDispositionIsAddedIfNonePresent() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Disposition', 'inline'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $attachment = $this->createAttachment($headers, $this->createEncoder(), - $this->createCache() - ); - $attachment->setDisposition('inline'); - } - - public function testDispositionIsAutoDefaultedToAttachment() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Disposition', 'attachment'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $attachment = $this->createAttachment($headers, $this->createEncoder(), - $this->createCache() - ); - } - - public function testDefaultContentTypeInitializedToOctetStream() - { - $cType = $this->createHeader('Content-Type', '', - [], false - ); - $cType->shouldReceive('setFieldBodyModel') - ->once() - ->with('application/octet-stream'); - $cType->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $attachment = $this->createAttachment($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - } - - public function testFilenameIsReturnedFromHeader() - { - /* -- RFC 2183, 2.3. - */ - - $disposition = $this->createHeader('Content-Disposition', 'attachment', - ['filename' => 'foo.txt'] - ); - $attachment = $this->createAttachment($this->createHeaderSet([ - 'Content-Disposition' => $disposition, ]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals('foo.txt', $attachment->getFilename()); - } - - public function testFilenameIsSetInHeader() - { - $disposition = $this->createHeader('Content-Disposition', 'attachment', - ['filename' => 'foo.txt'], false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('filename', 'bar.txt'); - $disposition->shouldReceive('setParameter') - ->zeroOrMoreTimes(); - - $attachment = $this->createAttachment($this->createHeaderSet([ - 'Content-Disposition' => $disposition, ]), - $this->createEncoder(), $this->createCache() - ); - $attachment->setFilename('bar.txt'); - } - - public function testSettingFilenameSetsNameInContentType() - { - /* - This is a legacy requirement which isn't covered by up-to-date RFCs. - */ - - $cType = $this->createHeader('Content-Type', 'text/plain', - [], false - ); - $cType->shouldReceive('setParameter') - ->once() - ->with('name', 'bar.txt'); - $cType->shouldReceive('setParameter') - ->zeroOrMoreTimes(); - - $attachment = $this->createAttachment($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $attachment->setFilename('bar.txt'); - } - - public function testSizeIsReturnedFromHeader() - { - /* -- RFC 2183, 2.7. - */ - - $disposition = $this->createHeader('Content-Disposition', 'attachment', - ['size' => 1234] - ); - $attachment = $this->createAttachment($this->createHeaderSet([ - 'Content-Disposition' => $disposition, ]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals(1234, $attachment->getSize()); - } - - public function testSizeIsSetInHeader() - { - $disposition = $this->createHeader('Content-Disposition', 'attachment', - [], false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('size', 12345); - $disposition->shouldReceive('setParameter') - ->zeroOrMoreTimes(); - - $attachment = $this->createAttachment($this->createHeaderSet([ - 'Content-Disposition' => $disposition, ]), - $this->createEncoder(), $this->createCache() - ); - $attachment->setSize(12345); - } - - public function testFilnameCanBeReadFromFileStream() - { - $file = $this->createFileStream('/bar/file.ext', ''); - $disposition = $this->createHeader('Content-Disposition', 'attachment', - ['filename' => 'foo.txt'], false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('filename', 'file.ext'); - - $attachment = $this->createAttachment($this->createHeaderSet([ - 'Content-Disposition' => $disposition, ]), - $this->createEncoder(), $this->createCache() - ); - $attachment->setFile($file); - } - - public function testContentTypeCanBeSetViaSetFile() - { - $file = $this->createFileStream('/bar/file.ext', ''); - $disposition = $this->createHeader('Content-Disposition', 'attachment', - ['filename' => 'foo.txt'], false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('filename', 'file.ext'); - - $ctype = $this->createHeader('Content-Type', 'text/plain', [], false); - $ctype->shouldReceive('setFieldBodyModel') - ->once() - ->with('text/html'); - $ctype->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $headers = $this->createHeaderSet([ - 'Content-Disposition' => $disposition, - 'Content-Type' => $ctype, - ]); - - $attachment = $this->createAttachment($headers, $this->createEncoder(), - $this->createCache() - ); - $attachment->setFile($file, 'text/html'); - } - - public function XtestContentTypeCanBeLookedUpFromCommonListIfNotProvided() - { - $file = $this->createFileStream('/bar/file.zip', ''); - $disposition = $this->createHeader('Content-Disposition', 'attachment', - ['filename' => 'foo.zip'], false - ); - $disposition->shouldReceive('setParameter') - ->once() - ->with('filename', 'file.zip'); - - $ctype = $this->createHeader('Content-Type', 'text/plain', [], false); - $ctype->shouldReceive('setFieldBodyModel') - ->once() - ->with('application/zip'); - $ctype->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $headers = $this->createHeaderSet([ - 'Content-Disposition' => $disposition, - 'Content-Type' => $ctype, - ]); - - $attachment = $this->createAttachment($headers, $this->createEncoder(), - $this->createCache(), ['zip' => 'application/zip', 'txt' => 'text/plain'] - ); - $attachment->setFile($file); - } - - public function testDataCanBeReadFromFile() - { - $file = $this->createFileStream('/foo/file.ext', ''); - $attachment = $this->createAttachment($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $attachment->setFile($file); - $this->assertEquals('', $attachment->getBody()); - } - - public function testFluidInterface() - { - $attachment = $this->createAttachment($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $this->assertSame($attachment, - $attachment - ->setContentType('application/pdf') - ->setEncoder($this->createEncoder()) - ->setId('foo@bar') - ->setDescription('my pdf') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren([]) - ->setDisposition('inline') - ->setFilename('afile.txt') - ->setSize(123) - ->setFile($this->createFileStream('foo.txt', '')) - ); - } - - protected function createEntity($headers, $encoder, $cache) - { - return $this->createAttachment($headers, $encoder, $cache); - } - - protected function createAttachment($headers, $encoder, $cache, $mimeTypes = []) - { - $idGenerator = new Swift_Mime_IdGenerator('example.com'); - - return new Swift_Mime_Attachment($headers, $encoder, $cache, $idGenerator, $mimeTypes); - } - - protected function createFileStream($path, $data, $stub = true) - { - $file = $this->getMockery('Swift_FileStream'); - $file->shouldReceive('getPath') - ->zeroOrMoreTimes() - ->andReturn($path); - $file->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use ($data) { - static $first = true; - if (!$first) { - return false; - } - - $first = false; - - return $data; - }); - $file->shouldReceive('setReadPointer') - ->zeroOrMoreTimes(); - - return $file; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php deleted file mode 100644 index a05c68a46..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/Base64ContentEncoderTest.php +++ /dev/null @@ -1,323 +0,0 @@ -encoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - } - - public function testNameIsBase64() - { - $this->assertEquals('base64', $this->encoder->getName()); - } - - /* - There's really no point in testing the entire base64 encoding to the - level QP encoding has been tested. base64_encode() has been in PHP for - years. - */ - - public function testInputOutputRatioIs3to4Bytes() - { - /* - RFC 2045, 6.8 - - The encoding process represents 24-bit groups of input bits as output - strings of 4 encoded characters. Proceeding from left to right, a - 24-bit input group is formed by concatenating 3 8bit input groups. - These 24 bits are then treated as 4 concatenated 6-bit groups, each - of which is translated into a single digit in the base64 alphabet. - */ - - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('123'); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->encoder->encodeByteStream($os, $is); - $this->assertEquals('MTIz', $collection->content); - } - - public function testPadLength() - { - /* - RFC 2045, 6.8 - - Special processing is performed if fewer than 24 bits are available - at the end of the data being encoded. A full encoding quantum is - always completed at the end of a body. When fewer than 24 input bits - are available in an input group, zero bits are added (on the right) - to form an integral number of 6-bit groups. Padding at the end of - the data is performed using the "=" character. Since all base64 - input is an integral number of octets, only the following cases can - arise: (1) the final quantum of encoding input is an integral - multiple of 24 bits; here, the final unit of encoded output will be - an integral multiple of 4 characters with no "=" padding, (2) the - final quantum of encoding input is exactly 8 bits; here, the final - unit of encoded output will be two characters followed by two "=" - padding characters, or (3) the final quantum of encoding input is - exactly 16 bits; here, the final unit of encoded output will be three - characters followed by one "=" padding character. - */ - - for ($i = 0; $i < 30; ++$i) { - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn(pack('C', random_int(0, 255))); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->encoder->encodeByteStream($os, $is); - $this->assertRegExp('~^[a-zA-Z0-9/\+]{2}==$~', $collection->content, - '%s: A single byte should have 2 bytes of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn(pack('C*', random_int(0, 255), random_int(0, 255))); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->encoder->encodeByteStream($os, $is); - $this->assertRegExp('~^[a-zA-Z0-9/\+]{3}=$~', $collection->content, - '%s: Two bytes should have 1 byte of padding' - ); - } - - for ($i = 0; $i < 30; ++$i) { - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn(pack('C*', random_int(0, 255), random_int(0, 255), random_int(0, 255))); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->encoder->encodeByteStream($os, $is); - $this->assertRegExp('~^[a-zA-Z0-9/\+]{4}$~', $collection->content, - '%s: Three bytes should have no padding' - ); - } - } - - public function testMaximumLineLengthIs76Characters() - { - /* - The encoded output stream must be represented in lines of no more - than 76 characters each. All line breaks or other characters not - found in Table 1 must be ignored by decoding software. - */ - - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //12 - $os->shouldReceive('read') - ->once() - ->andReturn('mnopqrstuvwx'); //24 - $os->shouldReceive('read') - ->once() - ->andReturn('yzabc1234567'); //36 - $os->shouldReceive('read') - ->once() - ->andReturn('890ABCDEFGHI'); //48 - $os->shouldReceive('read') - ->once() - ->andReturn('JKLMNOPQRSTU'); //60 - $os->shouldReceive('read') - ->once() - ->andReturn('VWXYZ1234567'); //72 - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //84 - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->encoder->encodeByteStream($os, $is); - $this->assertEquals( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDREVGR0hJSktMTU5PUFFS\r\n". - 'U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts', - $collection->content - ); - } - - public function testMaximumLineLengthCanBeDifferent() - { - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //12 - $os->shouldReceive('read') - ->once() - ->andReturn('mnopqrstuvwx'); //24 - $os->shouldReceive('read') - ->once() - ->andReturn('yzabc1234567'); //36 - $os->shouldReceive('read') - ->once() - ->andReturn('890ABCDEFGHI'); //48 - $os->shouldReceive('read') - ->once() - ->andReturn('JKLMNOPQRSTU'); //60 - $os->shouldReceive('read') - ->once() - ->andReturn('VWXYZ1234567'); //72 - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //84 - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->encoder->encodeByteStream($os, $is, 0, 50); - $this->assertEquals( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3OD\r\n". - "kwQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY3YWJj\r\n". - 'ZGVmZ2hpamts', - $collection->content - ); - } - - public function testMaximumLineLengthIsNeverMoreThan76Chars() - { - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //12 - $os->shouldReceive('read') - ->once() - ->andReturn('mnopqrstuvwx'); //24 - $os->shouldReceive('read') - ->once() - ->andReturn('yzabc1234567'); //36 - $os->shouldReceive('read') - ->once() - ->andReturn('890ABCDEFGHI'); //48 - $os->shouldReceive('read') - ->once() - ->andReturn('JKLMNOPQRSTU'); //60 - $os->shouldReceive('read') - ->once() - ->andReturn('VWXYZ1234567'); //72 - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //84 - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->encoder->encodeByteStream($os, $is, 0, 100); - $this->assertEquals( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDREVGR0hJSktMTU5PUFFS\r\n". - 'U1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts', - $collection->content - ); - } - - public function testFirstLineLengthCanBeDifferent() - { - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //12 - $os->shouldReceive('read') - ->once() - ->andReturn('mnopqrstuvwx'); //24 - $os->shouldReceive('read') - ->once() - ->andReturn('yzabc1234567'); //36 - $os->shouldReceive('read') - ->once() - ->andReturn('890ABCDEFGHI'); //48 - $os->shouldReceive('read') - ->once() - ->andReturn('JKLMNOPQRSTU'); //60 - $os->shouldReceive('read') - ->once() - ->andReturn('VWXYZ1234567'); //72 - $os->shouldReceive('read') - ->once() - ->andReturn('abcdefghijkl'); //84 - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->encoder->encodeByteStream($os, $is, 19); - $this->assertEquals( - "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXphYmMxMjM0NTY3ODkwQUJDR\r\n". - 'EVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY3YWJjZGVmZ2hpamts', - $collection->content - ); - } - - private function createOutputByteStream($stub = false) - { - return $this->getMockery('Swift_OutputByteStream')->shouldIgnoreMissing(); - } - - private function createInputByteStream($stub = false) - { - return $this->getMockery('Swift_InputByteStream')->shouldIgnoreMissing(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php deleted file mode 100644 index 270d02c3c..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/PlainContentEncoderTest.php +++ /dev/null @@ -1,171 +0,0 @@ -getEncoder('7bit'); - $this->assertEquals('7bit', $encoder->getName()); - - $encoder = $this->getEncoder('8bit'); - $this->assertEquals('8bit', $encoder->getName()); - } - - public function testNoOctetsAreModifiedInString() - { - $encoder = $this->getEncoder('7bit'); - foreach (range(0x00, 0xFF) as $octet) { - $byte = pack('C', $octet); - $this->assertIdenticalBinary($byte, $encoder->encodeString($byte)); - } - } - - public function testNoOctetsAreModifiedInByteStream() - { - $encoder = $this->getEncoder('7bit'); - foreach (range(0x00, 0xFF) as $octet) { - $byte = pack('C', $octet); - - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn($byte); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder->encodeByteStream($os, $is); - $this->assertIdenticalBinary($byte, $collection->content); - } - } - - public function testLineLengthCanBeSpecified() - { - $encoder = $this->getEncoder('7bit'); - - $chars = []; - for ($i = 0; $i < 50; ++$i) { - $chars[] = 'a'; - } - $input = implode(' ', $chars); //99 chars long - - $this->assertEquals( - 'a a a a a a a a a a a a a a a a a a a a a a a a a '."\r\n".//50 * - 'a a a a a a a a a a a a a a a a a a a a a a a a a', //99 - $encoder->encodeString($input, 0, 50), - '%s: Lines should be wrapped at 50 chars' - ); - } - - public function testLineLengthCanBeSpecifiedInByteStream() - { - $encoder = $this->getEncoder('7bit'); - - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - - for ($i = 0; $i < 50; ++$i) { - $os->shouldReceive('read') - ->once() - ->andReturn('a '); - } - - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder->encodeByteStream($os, $is, 0, 50); - $this->assertEquals( - str_repeat('a ', 25)."\r\n".str_repeat('a ', 25), - $collection->content - ); - } - - public function testencodeStringGeneratesCorrectCrlf() - { - $encoder = $this->getEncoder('7bit', true); - $this->assertEquals("a\r\nb", $encoder->encodeString("a\rb"), - '%s: Line endings should be standardized' - ); - $this->assertEquals("a\r\nb", $encoder->encodeString("a\nb"), - '%s: Line endings should be standardized' - ); - $this->assertEquals("a\r\n\r\nb", $encoder->encodeString("a\n\rb"), - '%s: Line endings should be standardized' - ); - $this->assertEquals("a\r\n\r\nb", $encoder->encodeString("a\r\rb"), - '%s: Line endings should be standardized' - ); - $this->assertEquals("a\r\n\r\nb", $encoder->encodeString("a\n\nb"), - '%s: Line endings should be standardized' - ); - } - - public function crlfProvider() - { - return [ - ["\r", "a\r\nb"], - ["\n", "a\r\nb"], - ["\n\r", "a\r\n\r\nb"], - ["\n\n", "a\r\n\r\nb"], - ["\r\r", "a\r\n\r\nb"], - ]; - } - - /** - * @dataProvider crlfProvider - */ - public function testCanonicEncodeByteStreamGeneratesCorrectCrlf($test, $expected) - { - $encoder = $this->getEncoder('7bit', true); - - $os = $this->createOutputByteStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $os->shouldReceive('read') - ->once() - ->andReturn('a'); - $os->shouldReceive('read') - ->once() - ->andReturn($test); - $os->shouldReceive('read') - ->once() - ->andReturn('b'); - $os->shouldReceive('read') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder->encodeByteStream($os, $is); - $this->assertEquals($expected, $collection->content); - } - - private function getEncoder($name, $canonical = false) - { - return new Swift_Mime_ContentEncoder_PlainContentEncoder($name, $canonical); - } - - private function createOutputByteStream($stub = false) - { - return $this->getMockery('Swift_OutputByteStream')->shouldIgnoreMissing(); - } - - private function createInputByteStream($stub = false) - { - return $this->getMockery('Swift_InputByteStream')->shouldIgnoreMissing(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php deleted file mode 100644 index 4e050a158..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/ContentEncoder/QpContentEncoderTest.php +++ /dev/null @@ -1,516 +0,0 @@ -createCharacterStream(true) - ); - $this->assertEquals('quoted-printable', $encoder->getName()); - } - - /* -- RFC 2045, 6.7 -- - (1) (General 8bit representation) Any octet, except a CR or - LF that is part of a CRLF line break of the canonical - (standard) form of the data being encoded, may be - represented by an "=" followed by a two digit - hexadecimal representation of the octet's value. The - digits of the hexadecimal alphabet, for this purpose, - are "0123456789ABCDEF". Uppercase letters must be - used; lowercase letters are not allowed. Thus, for - example, the decimal value 12 (US-ASCII form feed) can - be represented by "=0C", and the decimal value 61 (US- - ASCII EQUAL SIGN) can be represented by "=3D". This - rule must be followed except when the following rules - allow an alternative encoding. - */ - - public function testPermittedCharactersAreNotEncoded() - { - /* -- RFC 2045, 6.7 -- - (2) (Literal representation) Octets with decimal values of - 33 through 60 inclusive, and 62 through 126, inclusive, - MAY be represented as the US-ASCII characters which - correspond to those octets (EXCLAMATION POINT through - LESS THAN, and GREATER THAN through TILDE, - respectively). - */ - - foreach (array_merge(range(33, 60), range(62, 126)) as $ordinal) { - $char = chr($ordinal); - - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([$ordinal]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertIdenticalBinary($char, $collection->content); - } - } - - public function testLinearWhiteSpaceAtLineEndingIsEncoded() - { - /* -- RFC 2045, 6.7 -- - (3) (White Space) Octets with values of 9 and 32 MAY be - represented as US-ASCII TAB (HT) and SPACE characters, - respectively, but MUST NOT be so represented at the end - of an encoded line. Any TAB (HT) or SPACE characters - on an encoded line MUST thus be followed on that line - by a printable character. In particular, an "=" at the - end of an encoded line, indicating a soft line break - (see rule #5) may follow one or more TAB (HT) or SPACE - characters. It follows that an octet with decimal - value 9 or 32 appearing at the end of an encoded line - must be represented according to Rule #1. This rule is - necessary because some MTAs (Message Transport Agents, - programs which transport messages from one user to - another, or perform a portion of such transfers) are - known to pad lines of text with SPACEs, and others are - known to remove "white space" characters from the end - of a line. Therefore, when decoding a Quoted-Printable - body, any trailing white space on a line must be - deleted, as it will necessarily have been added by - intermediate transport agents. - */ - - $HT = chr(0x09); //9 - $SPACE = chr(0x20); //32 - - //HT - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x09]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x09]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0D]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0A]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('b')]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - - $this->assertEquals("a\t=09\r\nb", $collection->content); - - //SPACE - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x20]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x20]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0D]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0A]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('b')]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - - $this->assertEquals("a =20\r\nb", $collection->content); - } - - public function testCRLFIsLeftAlone() - { - /* - (4) (Line Breaks) A line break in a text body, represented - as a CRLF sequence in the text canonical form, must be - represented by a (RFC 822) line break, which is also a - CRLF sequence, in the Quoted-Printable encoding. Since - the canonical representation of media types other than - text do not generally include the representation of - line breaks as CRLF sequences, no hard line breaks - (i.e. line breaks that are intended to be meaningful - and to be displayed to the user) can occur in the - quoted-printable encoding of such types. Sequences - like "=0D", "=0A", "=0A=0D" and "=0D=0A" will routinely - appear in non-text data represented in quoted- - printable, of course. - - Note that many implementations may elect to encode the - local representation of various content types directly - rather than converting to canonical form first, - encoding, and then converting back to local - representation. In particular, this may apply to plain - text material on systems that use newline conventions - other than a CRLF terminator sequence. Such an - implementation optimization is permissible, but only - when the combined canonicalization-encoding step is - equivalent to performing the three steps separately. - */ - - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0D]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0A]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('b')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0D]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0A]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('c')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0D]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x0A]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals("a\r\nb\r\nc\r\n", $collection->content); - } - - public function testLinesLongerThan76CharactersAreSoftBroken() - { - /* - (5) (Soft Line Breaks) The Quoted-Printable encoding - REQUIRES that encoded lines be no more than 76 - characters long. If longer lines are to be encoded - with the Quoted-Printable encoding, "soft" line breaks - must be used. An equal sign as the last character on a - encoded line indicates such a non-significant ("soft") - line break in the encoded text. - */ - - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - - for ($seq = 0; $seq <= 140; ++$seq) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - } - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals(str_repeat('a', 75)."=\r\n".str_repeat('a', 66), $collection->content); - } - - public function testMaxLineLengthCanBeSpecified() - { - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - - for ($seq = 0; $seq <= 100; ++$seq) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - } - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is, 0, 54); - $this->assertEquals(str_repeat('a', 53)."=\r\n".str_repeat('a', 48), $collection->content); - } - - public function testBytesBelowPermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(0, 32) as $ordinal) { - $char = chr($ordinal); - - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([$ordinal]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals(sprintf('=%02X', $ordinal), $collection->content); - } - } - - public function testDecimalByte61IsEncoded() - { - /* - According to Rule (1 & 2) - */ - - $char = chr(61); - - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([61]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals(sprintf('=%02X', 61), $collection->content); - } - - public function testBytesAbovePermittedRangeAreEncoded() - { - /* - According to Rule (1 & 2) - */ - - foreach (range(127, 255) as $ordinal) { - $char = chr($ordinal); - - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([$ordinal]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is); - $this->assertEquals(sprintf('=%02X', $ordinal), $collection->content); - } - } - - public function testFirstLineLengthCanBeDifferent() - { - $os = $this->createOutputByteStream(true); - $charStream = $this->createCharacterStream(); - $is = $this->createInputByteStream(); - $collection = new Swift_StreamCollector(); - - $is->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturnUsing($collection); - $charStream->shouldReceive('flushContents') - ->once(); - $charStream->shouldReceive('importByteStream') - ->once() - ->with($os); - - for ($seq = 0; $seq <= 140; ++$seq) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - } - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - $encoder->encodeByteStream($os, $is, 22); - $this->assertEquals( - str_repeat('a', 53)."=\r\n".str_repeat('a', 75)."=\r\n".str_repeat('a', 13), - $collection->content - ); - } - - public function testObserverInterfaceCanChangeCharset() - { - $stream = $this->createCharacterStream(); - $stream->shouldReceive('setCharacterSet') - ->once() - ->with('windows-1252'); - - $encoder = new Swift_Mime_ContentEncoder_QpContentEncoder($stream); - $encoder->charsetChanged('windows-1252'); - } - - public function testTextIsPreWrapped() - { - $encoder = $this->createEncoder(); - - $input = str_repeat('a', 70)."\r\n". - str_repeat('a', 70)."\r\n". - str_repeat('a', 70); - - $os = new Swift_ByteStream_ArrayByteStream(); - $is = new Swift_ByteStream_ArrayByteStream(); - $is->write($input); - - $encoder->encodeByteStream($is, $os); - - $this->assertEquals( - $input, $os->read(PHP_INT_MAX) - ); - } - - private function createCharacterStream($stub = false) - { - return $this->getMockery('Swift_CharacterStream')->shouldIgnoreMissing(); - } - - private function createEncoder() - { - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $charStream = new Swift_CharacterStream_NgCharacterStream($factory, 'utf-8'); - - return new Swift_Mime_ContentEncoder_QpContentEncoder($charStream); - } - - private function createOutputByteStream($stub = false) - { - return $this->getMockery('Swift_OutputByteStream')->shouldIgnoreMissing(); - } - - private function createInputByteStream($stub = false) - { - return $this->getMockery('Swift_InputByteStream')->shouldIgnoreMissing(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php deleted file mode 100644 index 74f2accd3..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php +++ /dev/null @@ -1,59 +0,0 @@ -addToAssertionCount(1); - } - - public function testNestingLevelIsEmbedded() - { - $file = $this->createEmbeddedFile($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals( - Swift_Mime_SimpleMimeEntity::LEVEL_RELATED, $file->getNestingLevel() - ); - } - - public function testIdIsAutoGenerated() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addIdHeader') - ->once() - ->with('Content-ID', '/^.*?@.*?$/D'); - - $file = $this->createEmbeddedFile($headers, $this->createEncoder(), - $this->createCache() - ); - } - - public function testDefaultDispositionIsInline() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addParameterizedHeader') - ->once() - ->with('Content-Disposition', 'inline'); - $headers->shouldReceive('addParameterizedHeader') - ->zeroOrMoreTimes(); - - $file = $this->createEmbeddedFile($headers, $this->createEncoder(), - $this->createCache() - ); - } - - protected function createAttachment($headers, $encoder, $cache, $mimeTypes = []) - { - return $this->createEmbeddedFile($headers, $encoder, $cache, $mimeTypes); - } - - private function createEmbeddedFile($headers, $encoder, $cache) - { - $idGenerator = new Swift_Mime_IdGenerator('example.com'); - - return new Swift_Mime_EmbeddedFile($headers, $encoder, $cache, $idGenerator); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php deleted file mode 100644 index 0db540732..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php +++ /dev/null @@ -1,13 +0,0 @@ -assertEquals('B', $encoder->getName()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php deleted file mode 100644 index 1b42300c1..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/QpHeaderEncoderTest.php +++ /dev/null @@ -1,221 +0,0 @@ -createEncoder( - $this->createCharacterStream(true) - ); - $this->assertEquals('Q', $encoder->getName()); - } - - public function testSpaceAndTabNeverAppear() - { - /* -- RFC 2047, 4. - Only a subset of the printable ASCII characters may be used in - 'encoded-text'. Space and tab characters are not allowed, so that - the beginning and end of an 'encoded-word' are obvious. - */ - - $charStream = $this->createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->atLeast()->times(6) - ->andReturn([ord('a')], [0x20], [0x09], [0x20], [ord('b')], false); - - $encoder = $this->createEncoder($charStream); - $this->assertNotRegExp('~[ \t]~', $encoder->encodeString("a \t b"), - '%s: encoded-words in headers cannot contain LWSP as per RFC 2047.' - ); - } - - public function testSpaceIsRepresentedByUnderscore() - { - /* -- RFC 2047, 4.2. - (2) The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be - represented as "_" (underscore, ASCII 95.). (This character may - not pass through some internetwork mail gateways, but its use - will greatly enhance readability of "Q" encoded data with mail - readers that do not support this encoding.) Note that the "_" - always represents hexadecimal 20, even if the SPACE character - occupies a different code position in the character set in use. - */ - $charStream = $this->createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([0x20]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('b')]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->createEncoder($charStream); - $this->assertEquals('a_b', $encoder->encodeString('a b'), - '%s: Spaces can be represented by more readable underscores as per RFC 2047.' - ); - } - - public function testEqualsAndQuestionAndUnderscoreAreEncoded() - { - /* -- RFC 2047, 4.2. - (3) 8-bit values which correspond to printable ASCII characters other - than "=", "?", and "_" (underscore), MAY be represented as those - characters. (But see section 5 for restrictions.) In - particular, SPACE and TAB MUST NOT be represented as themselves - within encoded words. - */ - $charStream = $this->createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('=')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('?')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('_')]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->createEncoder($charStream); - $this->assertEquals('=3D=3F=5F', $encoder->encodeString('=?_'), - '%s: Chars =, ? and _ (underscore) may not appear as per RFC 2047.' - ); - } - - public function testParensAndQuotesAreEncoded() - { - /* -- RFC 2047, 5 (2). - A "Q"-encoded 'encoded-word' which appears in a 'comment' MUST NOT - contain the characters "(", ")" or " - */ - - $charStream = $this->createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('(')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('"')]); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord(')')]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->createEncoder($charStream); - $this->assertEquals('=28=22=29', $encoder->encodeString('(")'), - '%s: Chars (, " (DQUOTE) and ) may not appear as per RFC 2047.' - ); - } - - public function testOnlyCharactersAllowedInPhrasesAreUsed() - { - /* -- RFC 2047, 5. - (3) As a replacement for a 'word' entity within a 'phrase', for example, - one that precedes an address in a From, To, or Cc header. The ABNF - definition for 'phrase' from RFC 822 thus becomes: - - phrase = 1*( encoded-word / word ) - - In this case the set of characters that may be used in a "Q"-encoded - 'encoded-word' is restricted to: . An 'encoded-word' that appears within a - 'phrase' MUST be separated from any adjacent 'word', 'text' or - 'special' by 'linear-white-space'. - */ - - $allowedBytes = array_merge( - range(ord('a'), ord('z')), range(ord('A'), ord('Z')), - range(ord('0'), ord('9')), - [ord('!'), ord('*'), ord('+'), ord('-'), ord('/')] - ); - - foreach (range(0x00, 0xFF) as $byte) { - $char = pack('C', $byte); - - $charStream = $this->createCharacterStream(); - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([$byte]); - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->createEncoder($charStream); - $encodedChar = $encoder->encodeString($char); - - if (in_array($byte, $allowedBytes)) { - $this->assertEquals($char, $encodedChar, - '%s: Character '.$char.' should not be encoded.' - ); - } elseif (0x20 == $byte) { - //Special case - $this->assertEquals('_', $encodedChar, - '%s: Space character should be replaced.' - ); - } else { - $this->assertEquals(sprintf('=%02X', $byte), $encodedChar, - '%s: Byte '.$byte.' should be encoded.' - ); - } - } - } - - public function testEqualsNeverAppearsAtEndOfLine() - { - /* -- RFC 2047, 5 (3). - The 'encoded-text' in an 'encoded-word' must be self-contained; - 'encoded-text' MUST NOT be continued from one 'encoded-word' to - another. This implies that the 'encoded-text' portion of a "B" - 'encoded-word' will be a multiple of 4 characters long; for a "Q" - 'encoded-word', any "=" character that appears in the 'encoded-text' - portion will be followed by two hexadecimal characters. - */ - - $input = str_repeat('a', 140); - - $charStream = $this->createCharacterStream(); - - $output = ''; - $seq = 0; - for (; $seq < 140; ++$seq) { - $charStream->shouldReceive('readBytes') - ->once() - ->andReturn([ord('a')]); - - if (75 == $seq) { - $output .= "\r\n"; // =\r\n - } - $output .= 'a'; - } - - $charStream->shouldReceive('readBytes') - ->zeroOrMoreTimes() - ->andReturn(false); - - $encoder = $this->createEncoder($charStream); - $this->assertEquals($output, $encoder->encodeString($input)); - } - - private function createEncoder($charStream) - { - return new Swift_Mime_HeaderEncoder_QpHeaderEncoder($charStream); - } - - private function createCharacterStream($stub = false) - { - return $this->getMockery('Swift_CharacterStream')->shouldIgnoreMissing(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php deleted file mode 100644 index e41930618..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/DateHeaderTest.php +++ /dev/null @@ -1,90 +0,0 @@ -getHeader('Date'); - $this->assertEquals(Swift_Mime_Header::TYPE_DATE, $header->getFieldType()); - } - - public function testGetDateTime() - { - $dateTime = new DateTimeImmutable(); - $header = $this->getHeader('Date'); - $header->setDateTime($dateTime); - $this->assertSame($dateTime, $header->getDateTime()); - } - - public function testDateTimeCanBeSetBySetter() - { - $dateTime = new DateTimeImmutable(); - $header = $this->getHeader('Date'); - $header->setDateTime($dateTime); - $this->assertSame($dateTime, $header->getDateTime()); - } - - public function testDateTimeIsConvertedToImmutable() - { - $dateTime = new DateTime(); - $header = $this->getHeader('Date'); - $header->setDateTime($dateTime); - $this->assertInstanceOf('DateTimeImmutable', $header->getDateTime()); - $this->assertEquals($dateTime->getTimestamp(), $header->getDateTime()->getTimestamp()); - $this->assertEquals($dateTime->getTimezone(), $header->getDateTime()->getTimezone()); - } - - public function testDateTimeIsImmutable() - { - $dateTime = new DateTime('2000-01-01 12:00:00 Europe/Berlin'); - $header = $this->getHeader('Date'); - $header->setDateTime($dateTime); - - $dateTime->setDate(2002, 2, 2); - $this->assertEquals('Sat, 01 Jan 2000 12:00:00 +0100', $header->getDateTime()->format('r')); - $this->assertEquals('Sat, 01 Jan 2000 12:00:00 +0100', $header->getFieldBody()); - } - - public function testDateTimeIsConvertedToRfc2822Date() - { - $dateTime = new DateTimeImmutable('2000-01-01 12:00:00 Europe/Berlin'); - $header = $this->getHeader('Date'); - $header->setDateTime($dateTime); - $this->assertEquals('Sat, 01 Jan 2000 12:00:00 +0100', $header->getFieldBody()); - } - - public function testSetBodyModel() - { - $dateTime = new DateTimeImmutable(); - $header = $this->getHeader('Date'); - $header->setFieldBodyModel($dateTime); - $this->assertEquals($dateTime->format('r'), $header->getFieldBody()); - } - - public function testGetBodyModel() - { - $dateTime = new DateTimeImmutable(); - $header = $this->getHeader('Date'); - $header->setDateTime($dateTime); - $this->assertEquals($dateTime, $header->getFieldBodyModel()); - } - - public function testToString() - { - $dateTime = new DateTimeImmutable('2000-01-01 12:00:00 Europe/Berlin'); - $header = $this->getHeader('Date'); - $header->setDateTime($dateTime); - $this->assertEquals("Date: Sat, 01 Jan 2000 12:00:00 +0100\r\n", - $header->toString() - ); - } - - private function getHeader($name) - { - return new Swift_Mime_Headers_DateHeader($name); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php deleted file mode 100644 index 0d2edb7ea..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/IdentificationHeaderTest.php +++ /dev/null @@ -1,192 +0,0 @@ -getHeader('Message-ID'); - $this->assertEquals(Swift_Mime_Header::TYPE_ID, $header->getFieldType()); - } - - public function testValueMatchesMsgIdSpec() - { - /* -- RFC 2822, 3.6.4. - message-id = "Message-ID:" msg-id CRLF - - in-reply-to = "In-Reply-To:" 1*msg-id CRLF - - references = "References:" 1*msg-id CRLF - - msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS] - - id-left = dot-atom-text / no-fold-quote / obs-id-left - - id-right = dot-atom-text / no-fold-literal / obs-id-right - - no-fold-quote = DQUOTE *(qtext / quoted-pair) DQUOTE - - no-fold-literal = "[" *(dtext / quoted-pair) "]" - */ - - $header = $this->getHeader('Message-ID'); - $header->setId('id-left@id-right'); - $this->assertEquals('', $header->getFieldBody()); - } - - public function testIdCanBeRetrievedVerbatim() - { - $header = $this->getHeader('Message-ID'); - $header->setId('id-left@id-right'); - $this->assertEquals('id-left@id-right', $header->getId()); - } - - public function testMultipleIdsCanBeSet() - { - $header = $this->getHeader('References'); - $header->setIds(['a@b', 'x@y']); - $this->assertEquals(['a@b', 'x@y'], $header->getIds()); - } - - public function testSettingMultipleIdsProducesAListValue() - { - /* -- RFC 2822, 3.6.4. - The "References:" and "In-Reply-To:" field each contain one or more - unique message identifiers, optionally separated by CFWS. - - .. SNIP .. - - in-reply-to = "In-Reply-To:" 1*msg-id CRLF - - references = "References:" 1*msg-id CRLF - */ - - $header = $this->getHeader('References'); - $header->setIds(['a@b', 'x@y']); - $this->assertEquals(' ', $header->getFieldBody()); - } - - public function testIdLeftCanBeQuoted() - { - /* -- RFC 2822, 3.6.4. - id-left = dot-atom-text / no-fold-quote / obs-id-left - */ - - $header = $this->getHeader('References'); - $header->setId('"ab"@c'); - $this->assertEquals('"ab"@c', $header->getId()); - $this->assertEquals('<"ab"@c>', $header->getFieldBody()); - } - - public function testIdLeftCanContainAnglesAsQuotedPairs() - { - /* -- RFC 2822, 3.6.4. - no-fold-quote = DQUOTE *(qtext / quoted-pair) DQUOTE - */ - - $header = $this->getHeader('References'); - $header->setId('"a\\<\\>b"@c'); - $this->assertEquals('"a\\<\\>b"@c', $header->getId()); - $this->assertEquals('<"a\\<\\>b"@c>', $header->getFieldBody()); - } - - public function testIdLeftCanBeDotAtom() - { - $header = $this->getHeader('References'); - $header->setId('a.b+&%$.c@d'); - $this->assertEquals('a.b+&%$.c@d', $header->getId()); - $this->assertEquals('', $header->getFieldBody()); - } - - /** - * @expectedException \Exception - * @expectedMessageException "a b c" is not valid id-left - */ - public function testInvalidIdLeftThrowsException() - { - $header = $this->getHeader('References'); - $header->setId('a b c@d'); - } - - public function testIdRightCanBeDotAtom() - { - /* -- RFC 2822, 3.6.4. - id-right = dot-atom-text / no-fold-literal / obs-id-right - */ - - $header = $this->getHeader('References'); - $header->setId('a@b.c+&%$.d'); - $this->assertEquals('a@b.c+&%$.d', $header->getId()); - $this->assertEquals('', $header->getFieldBody()); - } - - public function testIdRightCanBeLiteral() - { - /* -- RFC 2822, 3.6.4. - no-fold-literal = "[" *(dtext / quoted-pair) "]" - */ - - $header = $this->getHeader('References'); - $header->setId('a@[1.2.3.4]'); - $this->assertEquals('a@[1.2.3.4]', $header->getId()); - $this->assertEquals('', $header->getFieldBody()); - } - - public function testIdRigthIsIdnEncoded() - { - $header = $this->getHeader('References'); - $header->setId('a@ä'); - $this->assertEquals('a@ä', $header->getId()); - $this->assertEquals('', $header->getFieldBody()); - } - - /** - * @expectedException \Exception - * @expectedMessageException "b c d" is not valid id-right - */ - public function testInvalidIdRightThrowsException() - { - $header = $this->getHeader('References'); - $header->setId('a@b c d'); - } - - /** - * @expectedException \Exception - * @expectedMessageException "abc" is does not contain @ - */ - public function testMissingAtSignThrowsException() - { - /* -- RFC 2822, 3.6.4. - msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS] - */ - $header = $this->getHeader('References'); - $header->setId('abc'); - } - - public function testSetBodyModel() - { - $header = $this->getHeader('Message-ID'); - $header->setFieldBodyModel('a@b'); - $this->assertEquals(['a@b'], $header->getIds()); - } - - public function testGetBodyModel() - { - $header = $this->getHeader('Message-ID'); - $header->setId('a@b'); - $this->assertEquals(['a@b'], $header->getFieldBodyModel()); - } - - public function testStringValue() - { - $header = $this->getHeader('References'); - $header->setIds(['a@b', 'x@y']); - $this->assertEquals('References: '."\r\n", $header->toString()); - } - - private function getHeader($name) - { - return new Swift_Mime_Headers_IdentificationHeader($name, new EmailValidator(), new Swift_AddressEncoder_IdnAddressEncoder()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php deleted file mode 100644 index f64f5db59..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/MailboxHeaderTest.php +++ /dev/null @@ -1,367 +0,0 @@ -getHeader('To'); - $this->assertEquals(Swift_Mime_Header::TYPE_MAILBOX, $header->getFieldType()); - } - - public function testMailboxIsSetForAddress() - { - $header = $this->getHeader('From'); - $header->setAddresses('chris@swiftmailer.org'); - $this->assertEquals(['chris@swiftmailer.org'], - $header->getNameAddressStrings() - ); - } - - public function testMailboxIsRenderedForNameAddress() - { - $header = $this->getHeader('From'); - $header->setNameAddresses(['chris@swiftmailer.org' => 'Chris Corbyn']); - $this->assertEquals( - ['Chris Corbyn '], $header->getNameAddressStrings() - ); - } - - public function testAddressCanBeReturnedForAddress() - { - $header = $this->getHeader('From'); - $header->setAddresses('chris@swiftmailer.org'); - $this->assertEquals(['chris@swiftmailer.org'], $header->getAddresses()); - } - - public function testAddressCanBeReturnedForNameAddress() - { - $header = $this->getHeader('From'); - $header->setNameAddresses(['chris@swiftmailer.org' => 'Chris Corbyn']); - $this->assertEquals(['chris@swiftmailer.org'], $header->getAddresses()); - } - - public function testQuotesInNameAreQuoted() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn, "DHE"', - ]); - $this->assertEquals( - ['"Chris Corbyn, \"DHE\"" '], - $header->getNameAddressStrings() - ); - } - - public function testEscapeCharsInNameAreQuoted() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn, \\escaped\\', - ]); - $this->assertEquals( - ['"Chris Corbyn, \\\\escaped\\\\" '], - $header->getNameAddressStrings() - ); - } - - public function testUtf8CharsInDomainAreIdnEncoded() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swïftmailer.org' => 'Chris Corbyn', - ]); - $this->assertEquals( - ['Chris Corbyn '], - $header->getNameAddressStrings() - ); - } - - /** - * @expectedException \Swift_AddressEncoderException - */ - public function testUtf8CharsInLocalPartThrows() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chrïs@swiftmailer.org' => 'Chris Corbyn', - ]); - $header->getNameAddressStrings(); - } - - public function testUtf8CharsInEmail() - { - $header = $this->getHeader('From', null, new Swift_AddressEncoder_Utf8AddressEncoder()); - $header->setNameAddresses([ - 'chrïs@swïftmailer.org' => 'Chris Corbyn', - ]); - $this->assertEquals( - ['Chris Corbyn '], - $header->getNameAddressStrings() - ); - } - - public function testGetMailboxesReturnsNameValuePairs() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn, DHE', - ]); - $this->assertEquals( - ['chris@swiftmailer.org' => 'Chris Corbyn, DHE'], $header->getNameAddresses() - ); - } - - public function testMultipleAddressesCanBeSetAndFetched() - { - $header = $this->getHeader('From'); - $header->setAddresses([ - 'chris@swiftmailer.org', 'mark@swiftmailer.org', - ]); - $this->assertEquals( - ['chris@swiftmailer.org', 'mark@swiftmailer.org'], - $header->getAddresses() - ); - } - - public function testMultipleAddressesAsMailboxes() - { - $header = $this->getHeader('From'); - $header->setAddresses([ - 'chris@swiftmailer.org', 'mark@swiftmailer.org', - ]); - $this->assertEquals( - ['chris@swiftmailer.org' => null, 'mark@swiftmailer.org' => null], - $header->getNameAddresses() - ); - } - - public function testMultipleAddressesAsMailboxStrings() - { - $header = $this->getHeader('From'); - $header->setAddresses([ - 'chris@swiftmailer.org', 'mark@swiftmailer.org', - ]); - $this->assertEquals( - ['chris@swiftmailer.org', 'mark@swiftmailer.org'], - $header->getNameAddressStrings() - ); - } - - public function testMultipleNamedMailboxesReturnsMultipleAddresses() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ]); - $this->assertEquals( - ['chris@swiftmailer.org', 'mark@swiftmailer.org'], - $header->getAddresses() - ); - } - - public function testMultipleNamedMailboxesReturnsMultipleMailboxes() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ]); - $this->assertEquals([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ], - $header->getNameAddresses() - ); - } - - public function testMultipleMailboxesProducesMultipleMailboxStrings() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ]); - $this->assertEquals([ - 'Chris Corbyn ', - 'Mark Corbyn ', - ], - $header->getNameAddressStrings() - ); - } - - public function testSetAddressesOverwritesAnyMailboxes() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ]); - $this->assertEquals( - ['chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', ], - $header->getNameAddresses() - ); - $this->assertEquals( - ['chris@swiftmailer.org', 'mark@swiftmailer.org'], - $header->getAddresses() - ); - - $header->setAddresses(['chris@swiftmailer.org', 'mark@swiftmailer.org']); - - $this->assertEquals( - ['chris@swiftmailer.org' => null, 'mark@swiftmailer.org' => null], - $header->getNameAddresses() - ); - $this->assertEquals( - ['chris@swiftmailer.org', 'mark@swiftmailer.org'], - $header->getAddresses() - ); - } - - public function testNameIsEncodedIfNonAscii() - { - $name = 'C'.pack('C', 0x8F).'rbyn'; - - $encoder = $this->getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($name, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('C=8Frbyn'); - - $header = $this->getHeader('From', $encoder); - $header->setNameAddresses(['chris@swiftmailer.org' => 'Chris '.$name]); - - $addresses = $header->getNameAddressStrings(); - $this->assertEquals( - 'Chris =?'.$this->charset.'?Q?C=8Frbyn?= ', - array_shift($addresses) - ); - } - - public function testEncodingLineLengthCalculations() - { - /* -- RFC 2047, 2. - An 'encoded-word' may not be more than 75 characters long, including - 'charset', 'encoding', 'encoded-text', and delimiters. - */ - - $name = 'C'.pack('C', 0x8F).'rbyn'; - - $encoder = $this->getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($name, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('C=8Frbyn'); - - $header = $this->getHeader('From', $encoder); - $header->setNameAddresses(['chris@swiftmailer.org' => 'Chris '.$name]); - - $header->getNameAddressStrings(); - } - - public function testGetValueReturnsMailboxStringValue() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - ]); - $this->assertEquals( - 'Chris Corbyn ', $header->getFieldBody() - ); - } - - public function testGetValueReturnsMailboxStringValueForMultipleMailboxes() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ]); - $this->assertEquals( - 'Chris Corbyn , Mark Corbyn ', - $header->getFieldBody() - ); - } - - public function testRemoveAddressesWithSingleValue() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ]); - $header->removeAddresses('chris@swiftmailer.org'); - $this->assertEquals(['mark@swiftmailer.org'], - $header->getAddresses() - ); - } - - public function testRemoveAddressesWithList() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ]); - $header->removeAddresses( - ['chris@swiftmailer.org', 'mark@swiftmailer.org'] - ); - $this->assertEquals([], $header->getAddresses()); - } - - public function testSetBodyModel() - { - $header = $this->getHeader('From'); - $header->setFieldBodyModel('chris@swiftmailer.org'); - $this->assertEquals(['chris@swiftmailer.org' => null], $header->getNameAddresses()); - } - - public function testGetBodyModel() - { - $header = $this->getHeader('From'); - $header->setAddresses(['chris@swiftmailer.org']); - $this->assertEquals(['chris@swiftmailer.org' => null], $header->getFieldBodyModel()); - } - - public function testToString() - { - $header = $this->getHeader('From'); - $header->setNameAddresses([ - 'chris@swiftmailer.org' => 'Chris Corbyn', - 'mark@swiftmailer.org' => 'Mark Corbyn', - ]); - $this->assertEquals( - 'From: Chris Corbyn , '. - 'Mark Corbyn '."\r\n", - $header->toString() - ); - } - - private function getHeader($name, $encoder = null, $addressEncoder = null) - { - $encoder = $encoder ?? $this->getEncoder('Q', true); - $addressEncoder = $addressEncoder ?? new Swift_AddressEncoder_IdnAddressEncoder(); - $header = new Swift_Mime_Headers_MailboxHeader($name, $encoder, new EmailValidator(), $addressEncoder); - $header->setCharset($this->charset); - - return $header; - } - - private function getEncoder($type) - { - $encoder = $this->getMockery('Swift_Mime_HeaderEncoder')->shouldIgnoreMissing(); - $encoder->shouldReceive('getName') - ->zeroOrMoreTimes() - ->andReturn($type); - - return $encoder; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php deleted file mode 100644 index c90b05b42..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ParameterizedHeaderTest.php +++ /dev/null @@ -1,396 +0,0 @@ -getHeader('Content-Type', - $this->getHeaderEncoder('Q', true), $this->getParameterEncoder(true) - ); - $this->assertEquals(Swift_Mime_Header::TYPE_PARAMETERIZED, $header->getFieldType()); - } - - public function testValueIsReturnedVerbatim() - { - $header = $this->getHeader('Content-Type', - $this->getHeaderEncoder('Q', true), $this->getParameterEncoder(true) - ); - $header->setValue('text/plain'); - $this->assertEquals('text/plain', $header->getValue()); - } - - public function testParametersAreAppended() - { - /* -- RFC 2045, 5.1 - parameter := attribute "=" value - - attribute := token - ; Matching of attributes - ; is ALWAYS case-insensitive. - - value := token / quoted-string - - token := 1* - - tspecials := "(" / ")" / "<" / ">" / "@" / - "," / ";" / ":" / "\" / <"> - "/" / "[" / "]" / "?" / "=" - ; Must be in quoted-string, - ; to use within parameter values - */ - - $header = $this->getHeader('Content-Type', - $this->getHeaderEncoder('Q', true), $this->getParameterEncoder(true) - ); - $header->setValue('text/plain'); - $header->setParameters(['charset' => 'utf-8']); - $this->assertEquals('text/plain; charset=utf-8', $header->getFieldBody()); - } - - public function testSpaceInParamResultsInQuotedString() - { - $header = $this->getHeader('Content-Disposition', - $this->getHeaderEncoder('Q', true), $this->getParameterEncoder(true) - ); - $header->setValue('attachment'); - $header->setParameters(['filename' => 'my file.txt']); - $this->assertEquals('attachment; filename="my file.txt"', - $header->getFieldBody() - ); - } - - public function testLongParamsAreBrokenIntoMultipleAttributeStrings() - { - /* -- RFC 2231, 3. - The asterisk character ("*") followed - by a decimal count is employed to indicate that multiple parameters - are being used to encapsulate a single parameter value. The count - starts at 0 and increments by 1 for each subsequent section of the - parameter value. Decimal values are used and neither leading zeroes - nor gaps in the sequence are allowed. - - The original parameter value is recovered by concatenating the - various sections of the parameter, in order. For example, the - content-type field - - Content-Type: message/external-body; access-type=URL; - URL*0="ftp://"; - URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" - - is semantically identical to - - Content-Type: message/external-body; access-type=URL; - URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" - - Note that quotes around parameter values are part of the value - syntax; they are NOT part of the value itself. Furthermore, it is - explicitly permitted to have a mixture of quoted and unquoted - continuation fields. - */ - - $value = str_repeat('a', 180); - - $encoder = $this->getParameterEncoder(); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), 63, \Mockery::any()) - ->andReturn(str_repeat('a', 63)."\r\n". - str_repeat('a', 63)."\r\n".str_repeat('a', 54)); - - $header = $this->getHeader('Content-Disposition', - $this->getHeaderEncoder('Q', true), $encoder - ); - $header->setValue('attachment'); - $header->setParameters(['filename' => $value]); - $header->setMaxLineLength(78); - $this->assertEquals( - 'attachment; '. - 'filename*0*=utf-8\'\''.str_repeat('a', 63).";\r\n ". - 'filename*1*='.str_repeat('a', 63).";\r\n ". - 'filename*2*='.str_repeat('a', 54), - $header->getFieldBody() - ); - } - - public function testEncodedParamDataIncludesCharsetAndLanguage() - { - /* -- RFC 2231, 4. - Asterisks ("*") are reused to provide the indicator that language and - character set information is present and encoding is being used. A - single quote ("'") is used to delimit the character set and language - information at the beginning of the parameter value. Percent signs - ("%") are used as the encoding flag, which agrees with RFC 2047. - - Specifically, an asterisk at the end of a parameter name acts as an - indicator that character set and language information may appear at - the beginning of the parameter value. A single quote is used to - separate the character set, language, and actual value information in - the parameter value string, and an percent sign is used to flag - octets encoded in hexadecimal. For example: - - Content-Type: application/x-stuff; - title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A - - Note that it is perfectly permissible to leave either the character - set or language field blank. Note also that the single quote - delimiters MUST be present even when one of the field values is - omitted. - */ - - $value = str_repeat('a', 20).pack('C', 0x8F).str_repeat('a', 10); - - $encoder = $this->getParameterEncoder(); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, 12, 62, \Mockery::any()) - ->andReturn(str_repeat('a', 20).'%8F'.str_repeat('a', 10)); - - $header = $this->getHeader('Content-Disposition', - $this->getHeaderEncoder('Q', true), $encoder - ); - $header->setValue('attachment'); - $header->setParameters(['filename' => $value]); - $header->setMaxLineLength(78); - $header->setLanguage($this->lang); - $this->assertEquals( - 'attachment; filename*='.$this->charset."'".$this->lang."'". - str_repeat('a', 20).'%8F'.str_repeat('a', 10), - $header->getFieldBody() - ); - } - - public function testMultipleEncodedParamLinesAreFormattedCorrectly() - { - /* -- RFC 2231, 4.1. - Character set and language information may be combined with the - parameter continuation mechanism. For example: - - Content-Type: application/x-stuff - title*0*=us-ascii'en'This%20is%20even%20more%20 - title*1*=%2A%2A%2Afun%2A%2A%2A%20 - title*2="isn't it!" - - Note that: - - (1) Language and character set information only appear at - the beginning of a given parameter value. - - (2) Continuations do not provide a facility for using more - than one character set or language in the same - parameter value. - - (3) A value presented using multiple continuations may - contain a mixture of encoded and unencoded segments. - - (4) The first segment of a continuation MUST be encoded if - language and character set information are given. - - (5) If the first segment of a continued parameter value is - encoded the language and character set field delimiters - MUST be present even when the fields are left blank. - */ - - $value = str_repeat('a', 20).pack('C', 0x8F).str_repeat('a', 60); - - $encoder = $this->getParameterEncoder(); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, 12, 62, \Mockery::any()) - ->andReturn(str_repeat('a', 20).'%8F'.str_repeat('a', 28)."\r\n". - str_repeat('a', 32)); - - $header = $this->getHeader('Content-Disposition', - $this->getHeaderEncoder('Q', true), $encoder - ); - $header->setValue('attachment'); - $header->setParameters(['filename' => $value]); - $header->setMaxLineLength(78); - $header->setLanguage($this->lang); - $this->assertEquals( - 'attachment; filename*0*='.$this->charset."'".$this->lang."'". - str_repeat('a', 20).'%8F'.str_repeat('a', 28).";\r\n ". - 'filename*1*='.str_repeat('a', 32), - $header->getFieldBody() - ); - } - - public function testToString() - { - $header = $this->getHeader('Content-Type', - $this->getHeaderEncoder('Q', true), $this->getParameterEncoder(true) - ); - $header->setValue('text/html'); - $header->setParameters(['charset' => 'utf-8']); - $this->assertEquals('Content-Type: text/html; charset=utf-8'."\r\n", - $header->toString() - ); - } - - public function testValueCanBeEncodedIfNonAscii() - { - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->getHeaderEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $header = $this->getHeader('X-Foo', $encoder, $this->getParameterEncoder(true)); - $header->setValue($value); - $header->setParameters(['lookslike' => 'foobar']); - $this->assertEquals('X-Foo: =?utf-8?Q?fo=8Fbar?=; lookslike=foobar'."\r\n", - $header->toString() - ); - } - - public function testValueAndParamCanBeEncodedIfNonAscii() - { - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->getHeaderEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $paramEncoder = $this->getParameterEncoder(); - $paramEncoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo%8Fbar'); - - $header = $this->getHeader('X-Foo', $encoder, $paramEncoder); - $header->setValue($value); - $header->setParameters(['says' => $value]); - $this->assertEquals("X-Foo: =?utf-8?Q?fo=8Fbar?=; says*=utf-8''fo%8Fbar\r\n", - $header->toString() - ); - } - - public function testParamsAreEncodedWithEncodedWordsIfNoParamEncoderSet() - { - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->getHeaderEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $header = $this->getHeader('X-Foo', $encoder, null); - $header->setValue('bar'); - $header->setParameters(['says' => $value]); - $this->assertEquals("X-Foo: bar; says=\"=?utf-8?Q?fo=8Fbar?=\"\r\n", - $header->toString() - ); - } - - public function testLanguageInformationAppearsInEncodedWords() - { - /* -- RFC 2231, 5. - 5. Language specification in Encoded Words - - RFC 2047 provides support for non-US-ASCII character sets in RFC 822 - message header comments, phrases, and any unstructured text field. - This is done by defining an encoded word construct which can appear - in any of these places. Given that these are fields intended for - display, it is sometimes necessary to associate language information - with encoded words as well as just the character set. This - specification extends the definition of an encoded word to allow the - inclusion of such information. This is simply done by suffixing the - character set specification with an asterisk followed by the language - tag. For example: - - From: =?US-ASCII*EN?Q?Keith_Moore?= - */ - - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->getHeaderEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $paramEncoder = $this->getParameterEncoder(); - $paramEncoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo%8Fbar'); - - $header = $this->getHeader('X-Foo', $encoder, $paramEncoder); - $header->setLanguage('en'); - $header->setValue($value); - $header->setParameters(['says' => $value]); - $this->assertEquals("X-Foo: =?utf-8*en?Q?fo=8Fbar?=; says*=utf-8'en'fo%8Fbar\r\n", - $header->toString() - ); - } - - public function testSetBodyModel() - { - $header = $this->getHeader('Content-Type', - $this->getHeaderEncoder('Q', true), $this->getParameterEncoder(true) - ); - $header->setFieldBodyModel('text/html'); - $this->assertEquals('text/html', $header->getValue()); - } - - public function testGetBodyModel() - { - $header = $this->getHeader('Content-Type', - $this->getHeaderEncoder('Q', true), $this->getParameterEncoder(true) - ); - $header->setValue('text/plain'); - $this->assertEquals('text/plain', $header->getFieldBodyModel()); - } - - public function testSetParameter() - { - $header = $this->getHeader('Content-Type', - $this->getHeaderEncoder('Q', true), $this->getParameterEncoder(true) - ); - $header->setParameters(['charset' => 'utf-8', 'delsp' => 'yes']); - $header->setParameter('delsp', 'no'); - $this->assertEquals(['charset' => 'utf-8', 'delsp' => 'no'], - $header->getParameters() - ); - } - - public function testGetParameter() - { - $header = $this->getHeader('Content-Type', - $this->getHeaderEncoder('Q', true), $this->getParameterEncoder(true) - ); - $header->setParameters(['charset' => 'utf-8', 'delsp' => 'yes']); - $this->assertEquals('utf-8', $header->getParameter('charset')); - } - - private function getHeader($name, $encoder, $paramEncoder) - { - $header = new Swift_Mime_Headers_ParameterizedHeader($name, $encoder, $paramEncoder); - $header->setCharset($this->charset); - - return $header; - } - - private function getHeaderEncoder($type, $stub = false) - { - $encoder = $this->getMockery('Swift_Mime_HeaderEncoder')->shouldIgnoreMissing(); - $encoder->shouldReceive('getName') - ->zeroOrMoreTimes() - ->andReturn($type); - - return $encoder; - } - - private function getParameterEncoder($stub = false) - { - return $this->getMockery('Swift_Encoder')->shouldIgnoreMissing(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php deleted file mode 100644 index 045107e59..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/PathHeaderTest.php +++ /dev/null @@ -1,95 +0,0 @@ -getHeader('Return-Path'); - $this->assertEquals(Swift_Mime_Header::TYPE_PATH, $header->getFieldType()); - } - - public function testSingleAddressCanBeSetAndFetched() - { - $header = $this->getHeader('Return-Path'); - $header->setAddress('chris@swiftmailer.org'); - $this->assertEquals('chris@swiftmailer.org', $header->getAddress()); - } - - /** - * @expectedException \Exception - */ - public function testAddressMustComplyWithRfc2822() - { - $header = $this->getHeader('Return-Path'); - $header->setAddress('chr is@swiftmailer.org'); - } - - public function testValueIsAngleAddrWithValidAddress() - { - /* -- RFC 2822, 3.6.7. - - return = "Return-Path:" path CRLF - - path = ([CFWS] "<" ([CFWS] / addr-spec) ">" [CFWS]) / - obs-path - */ - - $header = $this->getHeader('Return-Path'); - $header->setAddress('chris@swiftmailer.org'); - $this->assertEquals('', $header->getFieldBody()); - } - - public function testAddressIsIdnEncoded() - { - $header = $this->getHeader('Return-Path'); - $header->setAddress('chris@swïftmailer.org'); - $this->assertEquals('', $header->getFieldBody()); - } - - /** - * @expectedException \Swift_AddressEncoderException - */ - public function testAddressMustBeEncodable() - { - $header = $this->getHeader('Return-Path'); - $header->setAddress('chrïs@swiftmailer.org'); - $header->getFieldBody(); - } - - public function testValueIsEmptyAngleBracketsIfEmptyAddressSet() - { - $header = $this->getHeader('Return-Path'); - $header->setAddress(''); - $this->assertEquals('<>', $header->getFieldBody()); - } - - public function testSetBodyModel() - { - $header = $this->getHeader('Return-Path'); - $header->setFieldBodyModel('foo@bar.tld'); - $this->assertEquals('foo@bar.tld', $header->getAddress()); - } - - public function testGetBodyModel() - { - $header = $this->getHeader('Return-Path'); - $header->setAddress('foo@bar.tld'); - $this->assertEquals('foo@bar.tld', $header->getFieldBodyModel()); - } - - public function testToString() - { - $header = $this->getHeader('Return-Path'); - $header->setAddress('chris@swiftmailer.org'); - $this->assertEquals('Return-Path: '."\r\n", - $header->toString() - ); - } - - private function getHeader($name) - { - return new Swift_Mime_Headers_PathHeader($name, new EmailValidator(), new Swift_AddressEncoder_IdnAddressEncoder()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php deleted file mode 100644 index 30ccb00c1..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/UnstructuredHeaderTest.php +++ /dev/null @@ -1,353 +0,0 @@ -getHeader('Subject', $this->getEncoder('Q', true)); - $this->assertEquals(Swift_Mime_Header::TYPE_TEXT, $header->getFieldType()); - } - - public function testGetNameReturnsNameVerbatim() - { - $header = $this->getHeader('Subject', $this->getEncoder('Q', true)); - $this->assertEquals('Subject', $header->getFieldName()); - } - - public function testGetValueReturnsValueVerbatim() - { - $header = $this->getHeader('Subject', $this->getEncoder('Q', true)); - $header->setValue('Test'); - $this->assertEquals('Test', $header->getValue()); - } - - public function testBasicStructureIsKeyValuePair() - { - /* -- RFC 2822, 2.2 - Header fields are lines composed of a field name, followed by a colon - (":"), followed by a field body, and terminated by CRLF. - */ - $header = $this->getHeader('Subject', $this->getEncoder('Q', true)); - $header->setValue('Test'); - $this->assertEquals('Subject: Test'."\r\n", $header->toString()); - } - - public function testLongHeadersAreFoldedAtWordBoundary() - { - /* -- RFC 2822, 2.2.3 - Each header field is logically a single line of characters comprising - the field name, the colon, and the field body. For convenience - however, and to deal with the 998/78 character limitations per line, - the field body portion of a header field can be split into a multiple - line representation; this is called "folding". The general rule is - that wherever this standard allows for folding white space (not - simply WSP characters), a CRLF may be inserted before any WSP. - */ - - $value = 'The quick brown fox jumped over the fence, he was a very very '. - 'scary brown fox with a bushy tail'; - $header = $this->getHeader('X-Custom-Header', - $this->getEncoder('Q', true) - ); - $header->setValue($value); - $header->setMaxLineLength(78); //A safe [RFC 2822, 2.2.3] default - /* - X-Custom-Header: The quick brown fox jumped over the fence, he was a very very - scary brown fox with a bushy tail - */ - $this->assertEquals( - 'X-Custom-Header: The quick brown fox jumped over the fence, he was a'. - ' very very'."\r\n".//Folding - ' scary brown fox with a bushy tail'."\r\n", - $header->toString(), '%s: The header should have been folded at 78th char' - ); - } - - public function testPrintableAsciiOnlyAppearsInHeaders() - { - /* -- RFC 2822, 2.2. - A field name MUST be composed of printable US-ASCII characters (i.e., - characters that have values between 33 and 126, inclusive), except - colon. A field body may be composed of any US-ASCII characters, - except for CR and LF. - */ - - $nonAsciiChar = pack('C', 0x8F); - $header = $this->getHeader('X-Test', $this->getEncoder('Q', true)); - $header->setValue($nonAsciiChar); - $this->assertRegExp( - '~^[^:\x00-\x20\x80-\xFF]+: [^\x80-\xFF\r\n]+\r\n$~s', - $header->toString() - ); - } - - public function testEncodedWordsFollowGeneralStructure() - { - /* -- RFC 2047, 1. - Generally, an "encoded-word" is a sequence of printable ASCII - characters that begins with "=?", ends with "?=", and has two "?"s in - between. - */ - - $nonAsciiChar = pack('C', 0x8F); - $header = $this->getHeader('X-Test', $this->getEncoder('Q', true)); - $header->setValue($nonAsciiChar); - $this->assertRegExp( - '~^X-Test: \=?.*?\?.*?\?.*?\?=\r\n$~s', - $header->toString() - ); - } - - public function testEncodedWordIncludesCharsetAndEncodingMethodAndText() - { - /* -- RFC 2047, 2. - An 'encoded-word' is defined by the following ABNF grammar. The - notation of RFC 822 is used, with the exception that white space - characters MUST NOT appear between components of an 'encoded-word'. - - encoded-word = "=?" charset "?" encoding "?" encoded-text "?=" - */ - - $nonAsciiChar = pack('C', 0x8F); - - $encoder = $this->getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($nonAsciiChar, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('=8F'); - - $header = $this->getHeader('X-Test', $encoder); - $header->setValue($nonAsciiChar); - $this->assertEquals( - 'X-Test: =?'.$this->charset.'?Q?=8F?='."\r\n", - $header->toString() - ); - } - - public function testEncodedWordsAreUsedToEncodedNonPrintableAscii() - { - //SPACE and TAB permitted - $nonPrintableBytes = array_merge( - range(0x00, 0x08), range(0x10, 0x19), [0x7F] - ); - - foreach ($nonPrintableBytes as $byte) { - $char = pack('C', $byte); - $encodedChar = sprintf('=%02X', $byte); - - $encoder = $this->getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($char, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn($encodedChar); - - $header = $this->getHeader('X-A', $encoder); - $header->setValue($char); - - $this->assertEquals( - 'X-A: =?'.$this->charset.'?Q?'.$encodedChar.'?='."\r\n", - $header->toString(), '%s: Non-printable ascii should be encoded' - ); - } - } - - public function testEncodedWordsAreUsedToEncode8BitOctets() - { - foreach (range(0x80, 0xFF) as $byte) { - $char = pack('C', $byte); - $encodedChar = sprintf('=%02X', $byte); - - $encoder = $this->getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($char, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn($encodedChar); - - $header = $this->getHeader('X-A', $encoder); - $header->setValue($char); - - $this->assertEquals( - 'X-A: =?'.$this->charset.'?Q?'.$encodedChar.'?='."\r\n", - $header->toString(), '%s: 8-bit octets should be encoded' - ); - } - } - - public function testEncodedWordsAreNoMoreThan75CharsPerLine() - { - /* -- RFC 2047, 2. - An 'encoded-word' may not be more than 75 characters long, including - 'charset', 'encoding', 'encoded-text', and delimiters. - - ... SNIP ... - - While there is no limit to the length of a multiple-line header - field, each line of a header field that contains one or more - 'encoded-word's is limited to 76 characters. - */ - - $nonAsciiChar = pack('C', 0x8F); - - $encoder = $this->getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($nonAsciiChar, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('=8F'); - //Note that multi-line headers begin with LWSP which makes 75 + 1 = 76 - //Note also that =?utf-8?q??= is 12 chars which makes 75 - 12 = 63 - - //* X-Test: is 8 chars - $header = $this->getHeader('X-Test', $encoder); - $header->setValue($nonAsciiChar); - - $this->assertEquals( - 'X-Test: =?'.$this->charset.'?Q?=8F?='."\r\n", - $header->toString() - ); - } - - public function testFWSPIsUsedWhenEncoderReturnsMultipleLines() - { - /* --RFC 2047, 2. - If it is desirable to encode more text than will fit in an 'encoded-word' of - 75 characters, multiple 'encoded-word's (separated by CRLF SPACE) may - be used. - */ - - //Note the Mock does NOT return 8F encoded, the 8F merely triggers - // encoding for the sake of testing - $nonAsciiChar = pack('C', 0x8F); - - $encoder = $this->getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($nonAsciiChar, 8, 63, \Mockery::any()) - ->andReturn('line_one_here'."\r\n".'line_two_here'); - - //Note that multi-line headers begin with LWSP which makes 75 + 1 = 76 - //Note also that =?utf-8?q??= is 12 chars which makes 75 - 12 = 63 - - //* X-Test: is 8 chars - $header = $this->getHeader('X-Test', $encoder); - $header->setValue($nonAsciiChar); - - $this->assertEquals( - 'X-Test: =?'.$this->charset.'?Q?line_one_here?='."\r\n". - ' =?'.$this->charset.'?Q?line_two_here?='."\r\n", - $header->toString() - ); - } - - public function testAdjacentWordsAreEncodedTogether() - { - /* -- RFC 2047, 5 (1) - Ordinary ASCII text and 'encoded-word's may appear together in the - same header field. However, an 'encoded-word' that appears in a - header field defined as '*text' MUST be separated from any adjacent - 'encoded-word' or 'text' by 'linear-white-space'. - - -- RFC 2047, 2. - IMPORTANT: 'encoded-word's are designed to be recognized as 'atom's - by an RFC 822 parser. As a consequence, unencoded white space - characters (such as SPACE and HTAB) are FORBIDDEN within an - 'encoded-word'. - */ - - //It would be valid to encode all words needed, however it's probably - // easiest to encode the longest amount required at a time - - $word = 'w'.pack('C', 0x8F).'rd'; - $text = 'start '.$word.' '.$word.' then end '.$word; - // 'start', ' word word', ' and end', ' word' - - $encoder = $this->getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($word.' '.$word, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('w=8Frd_w=8Frd'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($word, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('w=8Frd'); - - $header = $this->getHeader('X-Test', $encoder); - $header->setValue($text); - - $headerString = $header->toString(); - - $this->assertEquals('X-Test: start =?'.$this->charset.'?Q?'. - 'w=8Frd_w=8Frd?= then end =?'.$this->charset.'?Q?'. - 'w=8Frd?='."\r\n", $headerString, - '%s: Adjacent encoded words should appear grouped with WSP encoded' - ); - } - - public function testLanguageInformationAppearsInEncodedWords() - { - /* -- RFC 2231, 5. - 5. Language specification in Encoded Words - - RFC 2047 provides support for non-US-ASCII character sets in RFC 822 - message header comments, phrases, and any unstructured text field. - This is done by defining an encoded word construct which can appear - in any of these places. Given that these are fields intended for - display, it is sometimes necessary to associate language information - with encoded words as well as just the character set. This - specification extends the definition of an encoded word to allow the - inclusion of such information. This is simply done by suffixing the - character set specification with an asterisk followed by the language - tag. For example: - - From: =?US-ASCII*EN?Q?Keith_Moore?= - */ - - $value = 'fo'.pack('C', 0x8F).'bar'; - - $encoder = $this->getEncoder('Q'); - $encoder->shouldReceive('encodeString') - ->once() - ->with($value, \Mockery::any(), \Mockery::any(), \Mockery::any()) - ->andReturn('fo=8Fbar'); - - $header = $this->getHeader('Subject', $encoder); - $header->setLanguage('en'); - $header->setValue($value); - $this->assertEquals("Subject: =?utf-8*en?Q?fo=8Fbar?=\r\n", - $header->toString() - ); - } - - public function testSetBodyModel() - { - $header = $this->getHeader('Subject', $this->getEncoder('Q', true)); - $header->setFieldBodyModel('test'); - $this->assertEquals('test', $header->getValue()); - } - - public function testGetBodyModel() - { - $header = $this->getHeader('Subject', $this->getEncoder('Q', true)); - $header->setValue('test'); - $this->assertEquals('test', $header->getFieldBodyModel()); - } - - private function getHeader($name, $encoder) - { - $header = new Swift_Mime_Headers_UnstructuredHeader($name, $encoder); - $header->setCharset($this->charset); - - return $header; - } - - private function getEncoder($type, $stub = false) - { - $encoder = $this->getMockery('Swift_Mime_HeaderEncoder')->shouldIgnoreMissing(); - $encoder->shouldReceive('getName') - ->zeroOrMoreTimes() - ->andReturn($type); - - return $encoder; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/IdGeneratorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/IdGeneratorTest.php deleted file mode 100644 index dfea58065..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/IdGeneratorTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertEquals('example.net', $idGenerator->getIdRight()); - - $idGenerator->setIdRight('example.com'); - $this->assertEquals('example.com', $idGenerator->getIdRight()); - } - - public function testIdGenerateId() - { - $idGenerator = new Swift_Mime_IdGenerator('example.net'); - $emailValidator = new EmailValidator(); - - $id = $idGenerator->generateId(); - $this->assertTrue($emailValidator->isValid($id, new RFCValidation())); - $this->assertRegExp('/^.{32}@example.net$/', $id); - - $anotherId = $idGenerator->generateId(); - $this->assertNotEquals($id, $anotherId); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php deleted file mode 100644 index 4575505fa..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/MimePartTest.php +++ /dev/null @@ -1,234 +0,0 @@ -createMimePart($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals( - Swift_Mime_SimpleMimeEntity::LEVEL_ALTERNATIVE, $part->getNestingLevel() - ); - } - - public function testCharsetIsReturnedFromHeader() - { - /* -- RFC 2046, 4.1.2. - A critical parameter that may be specified in the Content-Type field - for "text/plain" data is the character set. This is specified with a - "charset" parameter, as in: - - Content-type: text/plain; charset=iso-8859-1 - - Unlike some other parameter values, the values of the charset - parameter are NOT case sensitive. The default character set, which - must be assumed in the absence of a charset parameter, is US-ASCII. - */ - - $cType = $this->createHeader('Content-Type', 'text/plain', - ['charset' => 'iso-8859-1'] - ); - $part = $this->createMimePart($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals('iso-8859-1', $part->getCharset()); - } - - public function testCharsetIsSetInHeader() - { - $cType = $this->createHeader('Content-Type', 'text/plain', - ['charset' => 'iso-8859-1'], false - ); - $cType->shouldReceive('setParameter')->once()->with('charset', 'utf-8'); - - $part = $this->createMimePart($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $part->setCharset('utf-8'); - } - - public function testCharsetIsSetInHeaderIfPassedToSetBody() - { - $cType = $this->createHeader('Content-Type', 'text/plain', - ['charset' => 'iso-8859-1'], false - ); - $cType->shouldReceive('setParameter')->once()->with('charset', 'utf-8'); - - $part = $this->createMimePart($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $part->setBody('', 'text/plian', 'utf-8'); - } - - public function testSettingCharsetNotifiesEncoder() - { - $encoder = $this->createEncoder('quoted-printable', false); - $encoder->expects($this->once()) - ->method('charsetChanged') - ->with('utf-8'); - - $part = $this->createMimePart($this->createHeaderSet(), - $encoder, $this->createCache() - ); - $part->setCharset('utf-8'); - } - - public function testSettingCharsetNotifiesHeaders() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('charsetChanged') - ->zeroOrMoreTimes() - ->with('utf-8'); - - $part = $this->createMimePart($headers, $this->createEncoder(), - $this->createCache() - ); - $part->setCharset('utf-8'); - } - - public function testSettingCharsetNotifiesChildren() - { - $child = $this->createChild(0, '', false); - $child->shouldReceive('charsetChanged') - ->once() - ->with('windows-874'); - - $part = $this->createMimePart($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $part->setChildren([$child]); - $part->setCharset('windows-874'); - } - - public function testCharsetChangeUpdatesCharset() - { - $cType = $this->createHeader('Content-Type', 'text/plain', - ['charset' => 'iso-8859-1'], false - ); - $cType->shouldReceive('setParameter')->once()->with('charset', 'utf-8'); - - $part = $this->createMimePart($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $part->charsetChanged('utf-8'); - } - - public function testSettingCharsetClearsCache() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('toString') - ->zeroOrMoreTimes() - ->andReturn("Content-Type: text/plain; charset=utf-8\r\n"); - - $cache = $this->createCache(false); - - $entity = $this->createEntity($headers, $this->createEncoder(), - $cache - ); - - $entity->setBody("blah\r\nblah!"); - $entity->toString(); - - // Initialize the expectation here because we only care about what happens in setCharset() - $cache->shouldReceive('clearKey') - ->once() - ->with(\Mockery::any(), 'body'); - - $entity->setCharset('iso-2022'); - } - - public function testFormatIsReturnedFromHeader() - { - /* -- RFC 3676. - */ - - $cType = $this->createHeader('Content-Type', 'text/plain', - ['format' => 'flowed'] - ); - $part = $this->createMimePart($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals('flowed', $part->getFormat()); - } - - public function testFormatIsSetInHeader() - { - $cType = $this->createHeader('Content-Type', 'text/plain', [], false); - $cType->shouldReceive('setParameter')->once()->with('format', 'fixed'); - - $part = $this->createMimePart($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $part->setFormat('fixed'); - } - - public function testDelSpIsReturnedFromHeader() - { - /* -- RFC 3676. - */ - - $cType = $this->createHeader('Content-Type', 'text/plain', - ['delsp' => 'no'] - ); - $part = $this->createMimePart($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $this->assertFalse($part->getDelSp()); - } - - public function testDelSpIsSetInHeader() - { - $cType = $this->createHeader('Content-Type', 'text/plain', [], false); - $cType->shouldReceive('setParameter')->once()->with('delsp', 'yes'); - - $part = $this->createMimePart($this->createHeaderSet([ - 'Content-Type' => $cType, ]), - $this->createEncoder(), $this->createCache() - ); - $part->setDelSp(true); - } - - public function testFluidInterface() - { - $part = $this->createMimePart($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - - $this->assertSame($part, - $part - ->setContentType('text/plain') - ->setEncoder($this->createEncoder()) - ->setId('foo@bar') - ->setDescription('my description') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren([]) - ->setCharset('utf-8') - ->setFormat('flowed') - ->setDelSp(true) - ); - } - - //abstract - protected function createEntity($headers, $encoder, $cache) - { - return $this->createMimePart($headers, $encoder, $cache); - } - - protected function createMimePart($headers, $encoder, $cache) - { - $idGenerator = new Swift_Mime_IdGenerator('example.com'); - - return new Swift_Mime_MimePart($headers, $encoder, $cache, $idGenerator); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php deleted file mode 100644 index 6bc825efa..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderFactoryTest.php +++ /dev/null @@ -1,169 +0,0 @@ -factory = $this->createFactory(); - } - - public function testMailboxHeaderIsCorrectType() - { - $header = $this->factory->createMailboxHeader('X-Foo'); - $this->assertInstanceOf('Swift_Mime_Headers_MailboxHeader', $header); - } - - public function testMailboxHeaderHasCorrectName() - { - $header = $this->factory->createMailboxHeader('X-Foo'); - $this->assertEquals('X-Foo', $header->getFieldName()); - } - - public function testMailboxHeaderHasCorrectModel() - { - $header = $this->factory->createMailboxHeader('X-Foo', - ['foo@bar' => 'FooBar'] - ); - $this->assertEquals(['foo@bar' => 'FooBar'], $header->getFieldBodyModel()); - } - - public function testDateHeaderHasCorrectType() - { - $header = $this->factory->createDateHeader('X-Date'); - $this->assertInstanceOf('Swift_Mime_Headers_DateHeader', $header); - } - - public function testDateHeaderHasCorrectName() - { - $header = $this->factory->createDateHeader('X-Date'); - $this->assertEquals('X-Date', $header->getFieldName()); - } - - public function testDateHeaderHasCorrectModel() - { - $dateTime = new \DateTimeImmutable(); - $header = $this->factory->createDateHeader('X-Date', $dateTime); - $this->assertEquals($dateTime, $header->getFieldBodyModel()); - } - - public function testTextHeaderHasCorrectType() - { - $header = $this->factory->createTextHeader('X-Foo'); - $this->assertInstanceOf('Swift_Mime_Headers_UnstructuredHeader', $header); - } - - public function testTextHeaderHasCorrectName() - { - $header = $this->factory->createTextHeader('X-Foo'); - $this->assertEquals('X-Foo', $header->getFieldName()); - } - - public function testTextHeaderHasCorrectModel() - { - $header = $this->factory->createTextHeader('X-Foo', 'bar'); - $this->assertEquals('bar', $header->getFieldBodyModel()); - } - - public function testParameterizedHeaderHasCorrectType() - { - $header = $this->factory->createParameterizedHeader('X-Foo'); - $this->assertInstanceOf('Swift_Mime_Headers_ParameterizedHeader', $header); - } - - public function testParameterizedHeaderHasCorrectName() - { - $header = $this->factory->createParameterizedHeader('X-Foo'); - $this->assertEquals('X-Foo', $header->getFieldName()); - } - - public function testParameterizedHeaderHasCorrectModel() - { - $header = $this->factory->createParameterizedHeader('X-Foo', 'bar'); - $this->assertEquals('bar', $header->getFieldBodyModel()); - } - - public function testParameterizedHeaderHasCorrectParams() - { - $header = $this->factory->createParameterizedHeader('X-Foo', 'bar', - ['zip' => 'button'] - ); - $this->assertEquals(['zip' => 'button'], $header->getParameters()); - } - - public function testIdHeaderHasCorrectType() - { - $header = $this->factory->createIdHeader('X-ID'); - $this->assertInstanceOf('Swift_Mime_Headers_IdentificationHeader', $header); - } - - public function testIdHeaderHasCorrectName() - { - $header = $this->factory->createIdHeader('X-ID'); - $this->assertEquals('X-ID', $header->getFieldName()); - } - - public function testIdHeaderHasCorrectModel() - { - $header = $this->factory->createIdHeader('X-ID', 'xyz@abc'); - $this->assertEquals(['xyz@abc'], $header->getFieldBodyModel()); - } - - public function testPathHeaderHasCorrectType() - { - $header = $this->factory->createPathHeader('X-Path'); - $this->assertInstanceOf('Swift_Mime_Headers_PathHeader', $header); - } - - public function testPathHeaderHasCorrectName() - { - $header = $this->factory->createPathHeader('X-Path'); - $this->assertEquals('X-Path', $header->getFieldName()); - } - - public function testPathHeaderHasCorrectModel() - { - $header = $this->factory->createPathHeader('X-Path', 'foo@bar'); - $this->assertEquals('foo@bar', $header->getFieldBodyModel()); - } - - public function testCharsetChangeNotificationNotifiesEncoders() - { - $encoder = $this->createHeaderEncoder(); - $encoder->expects($this->once()) - ->method('charsetChanged') - ->with('utf-8'); - $paramEncoder = $this->createParamEncoder(); - $paramEncoder->expects($this->once()) - ->method('charsetChanged') - ->with('utf-8'); - - $factory = $this->createFactory($encoder, $paramEncoder); - - $factory->charsetChanged('utf-8'); - } - - private function createFactory($encoder = null, $paramEncoder = null) - { - return new Swift_Mime_SimpleHeaderFactory( - $encoder - ? $encoder : $this->createHeaderEncoder(), - $paramEncoder - ? $paramEncoder : $this->createParamEncoder(), - new EmailValidator() - ); - } - - private function createHeaderEncoder() - { - return $this->getMockBuilder('Swift_Mime_HeaderEncoder')->getMock(); - } - - private function createParamEncoder() - { - return $this->getMockBuilder('Swift_Encoder')->getMock(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php deleted file mode 100644 index 4ddbff74c..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleHeaderSetTest.php +++ /dev/null @@ -1,734 +0,0 @@ -createFactory(); - $factory->expects($this->once()) - ->method('createMailboxHeader') - ->with('From', ['person@domain' => 'Person']) - ->will($this->returnValue($this->createHeader('From'))); - - $set = $this->createSet($factory); - $set->addMailboxHeader('From', ['person@domain' => 'Person']); - } - - public function testAddDateHeaderDelegatesToFactory() - { - $dateTime = new DateTimeImmutable(); - - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createDateHeader') - ->with('Date', $dateTime) - ->will($this->returnValue($this->createHeader('Date'))); - - $set = $this->createSet($factory); - $set->addDateHeader('Date', $dateTime); - } - - public function testAddTextHeaderDelegatesToFactory() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createTextHeader') - ->with('Subject', 'some text') - ->will($this->returnValue($this->createHeader('Subject'))); - - $set = $this->createSet($factory); - $set->addTextHeader('Subject', 'some text'); - } - - public function testAddParameterizedHeaderDelegatesToFactory() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createParameterizedHeader') - ->with('Content-Type', 'text/plain', ['charset' => 'utf-8']) - ->will($this->returnValue($this->createHeader('Content-Type'))); - - $set = $this->createSet($factory); - $set->addParameterizedHeader('Content-Type', 'text/plain', - ['charset' => 'utf-8'] - ); - } - - public function testAddIdHeaderDelegatesToFactory() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->createHeader('Message-ID'))); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - } - - public function testAddPathHeaderDelegatesToFactory() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createPathHeader') - ->with('Return-Path', 'some@path') - ->will($this->returnValue($this->createHeader('Return-Path'))); - - $set = $this->createSet($factory); - $set->addPathHeader('Return-Path', 'some@path'); - } - - public function testHasReturnsFalseWhenNoHeaders() - { - $set = $this->createSet($this->createFactory()); - $this->assertFalse($set->has('Some-Header')); - } - - public function testAddedMailboxHeaderIsSeenByHas() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createMailboxHeader') - ->with('From', ['person@domain' => 'Person']) - ->will($this->returnValue($this->createHeader('From'))); - - $set = $this->createSet($factory); - $set->addMailboxHeader('From', ['person@domain' => 'Person']); - $this->assertTrue($set->has('From')); - } - - public function testAddedDateHeaderIsSeenByHas() - { - $dateTime = new DateTimeImmutable(); - - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createDateHeader') - ->with('Date', $dateTime) - ->will($this->returnValue($this->createHeader('Date'))); - - $set = $this->createSet($factory); - $set->addDateHeader('Date', $dateTime); - $this->assertTrue($set->has('Date')); - } - - public function testAddedTextHeaderIsSeenByHas() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createTextHeader') - ->with('Subject', 'some text') - ->will($this->returnValue($this->createHeader('Subject'))); - - $set = $this->createSet($factory); - $set->addTextHeader('Subject', 'some text'); - $this->assertTrue($set->has('Subject')); - } - - public function testAddedParameterizedHeaderIsSeenByHas() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createParameterizedHeader') - ->with('Content-Type', 'text/plain', ['charset' => 'utf-8']) - ->will($this->returnValue($this->createHeader('Content-Type'))); - - $set = $this->createSet($factory); - $set->addParameterizedHeader('Content-Type', 'text/plain', - ['charset' => 'utf-8'] - ); - $this->assertTrue($set->has('Content-Type')); - } - - public function testAddedIdHeaderIsSeenByHas() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->createHeader('Message-ID'))); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertTrue($set->has('Message-ID')); - } - - public function testAddedPathHeaderIsSeenByHas() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createPathHeader') - ->with('Return-Path', 'some@path') - ->will($this->returnValue($this->createHeader('Return-Path'))); - - $set = $this->createSet($factory); - $set->addPathHeader('Return-Path', 'some@path'); - $this->assertTrue($set->has('Return-Path')); - } - - public function testNewlySetHeaderIsSeenByHas() - { - $factory = $this->createFactory(); - $header = $this->createHeader('X-Foo', 'bar'); - $set = $this->createSet($factory); - $set->set($header); - $this->assertTrue($set->has('X-Foo')); - } - - public function testHasCanAcceptOffset() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->createHeader('Message-ID'))); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertTrue($set->has('Message-ID', 0)); - } - - public function testHasWithIllegalOffsetReturnsFalse() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->createHeader('Message-ID'))); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertFalse($set->has('Message-ID', 1)); - } - - public function testHasCanDistinguishMultipleHeaders() - { - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($this->createHeader('Message-ID'))); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($this->createHeader('Message-ID'))); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $this->assertTrue($set->has('Message-ID', 1)); - } - - public function testGetWithUnspecifiedOffset() - { - $header = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertSame($header, $set->get('Message-ID')); - } - - public function testGetWithSpeiciedOffset() - { - $header0 = $this->createHeader('Message-ID'); - $header1 = $this->createHeader('Message-ID'); - $header2 = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - $factory->expects($this->at(2)) - ->method('createIdHeader') - ->with('Message-ID', 'more@id') - ->will($this->returnValue($header2)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->addIdHeader('Message-ID', 'more@id'); - $this->assertSame($header1, $set->get('Message-ID', 1)); - } - - public function testGetReturnsNullIfHeaderNotSet() - { - $set = $this->createSet($this->createFactory()); - $this->assertNull($set->get('Message-ID', 99)); - } - - public function testGetAllReturnsAllHeadersMatchingName() - { - $header0 = $this->createHeader('Message-ID'); - $header1 = $this->createHeader('Message-ID'); - $header2 = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - $factory->expects($this->at(2)) - ->method('createIdHeader') - ->with('Message-ID', 'more@id') - ->will($this->returnValue($header2)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->addIdHeader('Message-ID', 'more@id'); - - $this->assertEquals([$header0, $header1, $header2], - $set->getAll('Message-ID') - ); - } - - public function testGetAllReturnsAllHeadersIfNoArguments() - { - $header0 = $this->createHeader('Message-ID'); - $header1 = $this->createHeader('Subject'); - $header2 = $this->createHeader('To'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Subject', 'thing') - ->will($this->returnValue($header1)); - $factory->expects($this->at(2)) - ->method('createIdHeader') - ->with('To', 'person@example.org') - ->will($this->returnValue($header2)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Subject', 'thing'); - $set->addIdHeader('To', 'person@example.org'); - - $this->assertEquals([$header0, $header1, $header2], - $set->getAll() - ); - } - - public function testGetAllReturnsEmptyArrayIfNoneSet() - { - $set = $this->createSet($this->createFactory()); - $this->assertEquals([], $set->getAll('Received')); - } - - public function testRemoveWithUnspecifiedOffset() - { - $header = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->remove('Message-ID'); - $this->assertFalse($set->has('Message-ID')); - } - - public function testRemoveWithSpecifiedIndexRemovesHeader() - { - $header0 = $this->createHeader('Message-ID'); - $header1 = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->remove('Message-ID', 0); - $this->assertFalse($set->has('Message-ID', 0)); - $this->assertTrue($set->has('Message-ID', 1)); - $this->assertTrue($set->has('Message-ID')); - $set->remove('Message-ID', 1); - $this->assertFalse($set->has('Message-ID', 1)); - $this->assertFalse($set->has('Message-ID')); - } - - public function testRemoveWithSpecifiedIndexLeavesOtherHeaders() - { - $header0 = $this->createHeader('Message-ID'); - $header1 = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->remove('Message-ID', 1); - $this->assertTrue($set->has('Message-ID', 0)); - } - - public function testRemoveWithInvalidOffsetDoesNothing() - { - $header = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->remove('Message-ID', 50); - $this->assertTrue($set->has('Message-ID')); - } - - public function testRemoveAllRemovesAllHeadersWithName() - { - $header0 = $this->createHeader('Message-ID'); - $header1 = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header0)); - $factory->expects($this->at(1)) - ->method('createIdHeader') - ->with('Message-ID', 'other@id') - ->will($this->returnValue($header1)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->addIdHeader('Message-ID', 'other@id'); - $set->removeAll('Message-ID'); - $this->assertFalse($set->has('Message-ID', 0)); - $this->assertFalse($set->has('Message-ID', 1)); - } - - public function testHasIsNotCaseSensitive() - { - $header = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertTrue($set->has('message-id')); - } - - public function testGetIsNotCaseSensitive() - { - $header = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertSame($header, $set->get('message-id')); - } - - public function testGetAllIsNotCaseSensitive() - { - $header = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $this->assertEquals([$header], $set->getAll('message-id')); - } - - public function testRemoveIsNotCaseSensitive() - { - $header = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->remove('message-id'); - $this->assertFalse($set->has('Message-ID')); - } - - public function testRemoveAllIsNotCaseSensitive() - { - $header = $this->createHeader('Message-ID'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createIdHeader') - ->with('Message-ID', 'some@id') - ->will($this->returnValue($header)); - - $set = $this->createSet($factory); - $set->addIdHeader('Message-ID', 'some@id'); - $set->removeAll('message-id'); - $this->assertFalse($set->has('Message-ID')); - } - - public function testToStringJoinsHeadersTogether() - { - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Foo', 'bar') - ->will($this->returnValue($this->createHeader('Foo', 'bar'))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('Zip', 'buttons') - ->will($this->returnValue($this->createHeader('Zip', 'buttons'))); - - $set = $this->createSet($factory); - $set->addTextHeader('Foo', 'bar'); - $set->addTextHeader('Zip', 'buttons'); - $this->assertEquals( - "Foo: bar\r\n". - "Zip: buttons\r\n", - $set->toString() - ); - } - - public function testHeadersWithoutBodiesAreNotDisplayed() - { - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Foo', 'bar') - ->will($this->returnValue($this->createHeader('Foo', 'bar'))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('Zip', '') - ->will($this->returnValue($this->createHeader('Zip', ''))); - - $set = $this->createSet($factory); - $set->addTextHeader('Foo', 'bar'); - $set->addTextHeader('Zip', ''); - $this->assertEquals( - "Foo: bar\r\n", - $set->toString() - ); - } - - public function testHeadersWithoutBodiesCanBeForcedToDisplay() - { - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Foo', '') - ->will($this->returnValue($this->createHeader('Foo', ''))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('Zip', '') - ->will($this->returnValue($this->createHeader('Zip', ''))); - - $set = $this->createSet($factory); - $set->addTextHeader('Foo', ''); - $set->addTextHeader('Zip', ''); - $set->setAlwaysDisplayed(['Foo', 'Zip']); - $this->assertEquals( - "Foo: \r\n". - "Zip: \r\n", - $set->toString() - ); - } - - public function testHeaderSequencesCanBeSpecified() - { - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Third', 'three') - ->will($this->returnValue($this->createHeader('Third', 'three'))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('First', 'one') - ->will($this->returnValue($this->createHeader('First', 'one'))); - $factory->expects($this->at(2)) - ->method('createTextHeader') - ->with('Second', 'two') - ->will($this->returnValue($this->createHeader('Second', 'two'))); - - $set = $this->createSet($factory); - $set->addTextHeader('Third', 'three'); - $set->addTextHeader('First', 'one'); - $set->addTextHeader('Second', 'two'); - - $set->defineOrdering(['First', 'Second', 'Third']); - - $this->assertEquals( - "First: one\r\n". - "Second: two\r\n". - "Third: three\r\n", - $set->toString() - ); - } - - public function testUnsortedHeadersAppearAtEnd() - { - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Fourth', 'four') - ->will($this->returnValue($this->createHeader('Fourth', 'four'))); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('Fifth', 'five') - ->will($this->returnValue($this->createHeader('Fifth', 'five'))); - $factory->expects($this->at(2)) - ->method('createTextHeader') - ->with('Third', 'three') - ->will($this->returnValue($this->createHeader('Third', 'three'))); - $factory->expects($this->at(3)) - ->method('createTextHeader') - ->with('First', 'one') - ->will($this->returnValue($this->createHeader('First', 'one'))); - $factory->expects($this->at(4)) - ->method('createTextHeader') - ->with('Second', 'two') - ->will($this->returnValue($this->createHeader('Second', 'two'))); - - $set = $this->createSet($factory); - $set->addTextHeader('Fourth', 'four'); - $set->addTextHeader('Fifth', 'five'); - $set->addTextHeader('Third', 'three'); - $set->addTextHeader('First', 'one'); - $set->addTextHeader('Second', 'two'); - - $set->defineOrdering(['First', 'Second', 'Third']); - - $this->assertEquals( - "First: one\r\n". - "Second: two\r\n". - "Third: three\r\n". - "Fourth: four\r\n". - "Fifth: five\r\n", - $set->toString() - ); - } - - public function testSettingCharsetNotifiesAlreadyExistingHeaders() - { - $subject = $this->createHeader('Subject', 'some text'); - $xHeader = $this->createHeader('X-Header', 'some text'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Subject', 'some text') - ->will($this->returnValue($subject)); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('X-Header', 'some text') - ->will($this->returnValue($xHeader)); - $subject->expects($this->once()) - ->method('setCharset') - ->with('utf-8'); - $xHeader->expects($this->once()) - ->method('setCharset') - ->with('utf-8'); - - $set = $this->createSet($factory); - $set->addTextHeader('Subject', 'some text'); - $set->addTextHeader('X-Header', 'some text'); - - $set->setCharset('utf-8'); - } - - public function testCharsetChangeNotifiesAlreadyExistingHeaders() - { - $subject = $this->createHeader('Subject', 'some text'); - $xHeader = $this->createHeader('X-Header', 'some text'); - $factory = $this->createFactory(); - $factory->expects($this->at(0)) - ->method('createTextHeader') - ->with('Subject', 'some text') - ->will($this->returnValue($subject)); - $factory->expects($this->at(1)) - ->method('createTextHeader') - ->with('X-Header', 'some text') - ->will($this->returnValue($xHeader)); - $subject->expects($this->once()) - ->method('setCharset') - ->with('utf-8'); - $xHeader->expects($this->once()) - ->method('setCharset') - ->with('utf-8'); - - $set = $this->createSet($factory); - $set->addTextHeader('Subject', 'some text'); - $set->addTextHeader('X-Header', 'some text'); - - $set->charsetChanged('utf-8'); - } - - public function testCharsetChangeNotifiesFactory() - { - $factory = $this->createFactory(); - $factory->expects($this->once()) - ->method('charsetChanged') - ->with('utf-8'); - - $set = $this->createSet($factory); - - $set->setCharset('utf-8'); - } - - private function createSet($factory) - { - return new Swift_Mime_SimpleHeaderSet($factory); - } - - private function createFactory() - { - return $this->getMockBuilder('Swift_Mime_SimpleHeaderFactory')->disableOriginalConstructor()->getMock(); - } - - private function createHeader($name, $body = '') - { - $header = $this->getMockBuilder('Swift_Mime_Header')->getMock(); - $header->expects($this->any()) - ->method('getFieldName') - ->will($this->returnValue($name)); - $header->expects($this->any()) - ->method('toString') - ->will($this->returnValue(sprintf("%s: %s\r\n", $name, $body))); - $header->expects($this->any()) - ->method('getFieldBody') - ->will($this->returnValue($body)); - - return $header; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php deleted file mode 100644 index c5662cbe3..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMessageTest.php +++ /dev/null @@ -1,837 +0,0 @@ -addToAssertionCount(1); - } - - public function testNestingLevelIsTop() - { - $message = $this->createMessage($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals( - Swift_Mime_SimpleMimeEntity::LEVEL_TOP, $message->getNestingLevel() - ); - } - - public function testDateIsReturnedFromHeader() - { - $dateTime = new DateTimeImmutable(); - - $date = $this->createHeader('Date', $dateTime); - $message = $this->createMessage( - $this->createHeaderSet(['Date' => $date]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals($dateTime, $message->getDate()); - } - - public function testDateIsSetInHeader() - { - $dateTime = new DateTimeImmutable(); - - $date = $this->createHeader('Date', new DateTimeImmutable(), [], false); - $date->shouldReceive('setFieldBodyModel') - ->once() - ->with($dateTime); - $date->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $message = $this->createMessage( - $this->createHeaderSet(['Date' => $date]), - $this->createEncoder(), $this->createCache() - ); - $message->setDate($dateTime); - } - - public function testDateHeaderIsCreatedIfNonePresent() - { - $dateTime = new DateTimeImmutable(); - - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addDateHeader') - ->once() - ->with('Date', $dateTime); - $headers->shouldReceive('addDateHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setDate($dateTime); - } - - public function testDateHeaderIsAddedDuringConstruction() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addDateHeader') - ->once() - ->with('Date', Mockery::type('DateTimeImmutable')); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - } - - public function testIdIsReturnedFromHeader() - { - /* -- RFC 2045, 7. - In constructing a high-level user agent, it may be desirable to allow - one body to make reference to another. Accordingly, bodies may be - labelled using the "Content-ID" header field, which is syntactically - identical to the "Message-ID" header field - */ - - $messageId = $this->createHeader('Message-ID', 'a@b'); - $message = $this->createMessage( - $this->createHeaderSet(['Message-ID' => $messageId]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals('a@b', $message->getId()); - } - - public function testIdIsSetInHeader() - { - $messageId = $this->createHeader('Message-ID', 'a@b', [], false); - $messageId->shouldReceive('setFieldBodyModel') - ->once() - ->with('x@y'); - $messageId->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $message = $this->createMessage( - $this->createHeaderSet(['Message-ID' => $messageId]), - $this->createEncoder(), $this->createCache() - ); - $message->setId('x@y'); - } - - public function testIdIsAutoGenerated() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addIdHeader') - ->once() - ->with('Message-ID', '/^.*?@.*?$/D'); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - } - - public function testSubjectIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.5. - */ - - $subject = $this->createHeader('Subject', 'example subject'); - $message = $this->createMessage( - $this->createHeaderSet(['Subject' => $subject]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals('example subject', $message->getSubject()); - } - - public function testSubjectIsSetInHeader() - { - $subject = $this->createHeader('Subject', '', [], false); - $subject->shouldReceive('setFieldBodyModel') - ->once() - ->with('foo'); - - $message = $this->createMessage( - $this->createHeaderSet(['Subject' => $subject]), - $this->createEncoder(), $this->createCache() - ); - $message->setSubject('foo'); - } - - public function testSubjectHeaderIsCreatedIfNotPresent() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addTextHeader') - ->once() - ->with('Subject', 'example subject'); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setSubject('example subject'); - } - - public function testReturnPathIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.7. - */ - - $path = $this->createHeader('Return-Path', 'bounces@domain'); - $message = $this->createMessage( - $this->createHeaderSet(['Return-Path' => $path]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals('bounces@domain', $message->getReturnPath()); - } - - public function testReturnPathIsSetInHeader() - { - $path = $this->createHeader('Return-Path', '', [], false); - $path->shouldReceive('setFieldBodyModel') - ->once() - ->with('bounces@domain'); - - $message = $this->createMessage( - $this->createHeaderSet(['Return-Path' => $path]), - $this->createEncoder(), $this->createCache() - ); - $message->setReturnPath('bounces@domain'); - } - - public function testReturnPathHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addPathHeader') - ->once() - ->with('Return-Path', 'bounces@domain'); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setReturnPath('bounces@domain'); - } - - public function testSenderIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.2. - */ - - $sender = $this->createHeader('Sender', ['sender@domain' => 'Name']); - $message = $this->createMessage( - $this->createHeaderSet(['Sender' => $sender]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals(['sender@domain' => 'Name'], $message->getSender()); - } - - public function testSenderIsSetInHeader() - { - $sender = $this->createHeader('Sender', ['sender@domain' => 'Name'], - [], false - ); - $sender->shouldReceive('setFieldBodyModel') - ->once() - ->with(['other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['Sender' => $sender]), - $this->createEncoder(), $this->createCache() - ); - $message->setSender(['other@domain' => 'Other']); - } - - public function testSenderHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Sender', (array) 'sender@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setSender('sender@domain'); - } - - public function testNameCanBeUsedInSenderHeader() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Sender', ['sender@domain' => 'Name']); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setSender('sender@domain', 'Name'); - } - - public function testFromIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.2. - */ - - $from = $this->createHeader('From', ['from@domain' => 'Name']); - $message = $this->createMessage( - $this->createHeaderSet(['From' => $from]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals(['from@domain' => 'Name'], $message->getFrom()); - } - - public function testFromIsSetInHeader() - { - $from = $this->createHeader('From', ['from@domain' => 'Name'], - [], false - ); - $from->shouldReceive('setFieldBodyModel') - ->once() - ->with(['other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['From' => $from]), - $this->createEncoder(), $this->createCache() - ); - $message->setFrom(['other@domain' => 'Other']); - } - - public function testFromIsAddedToHeadersDuringAddFrom() - { - $from = $this->createHeader('From', ['from@domain' => 'Name'], - [], false - ); - $from->shouldReceive('setFieldBodyModel') - ->once() - ->with(['from@domain' => 'Name', 'other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['From' => $from]), - $this->createEncoder(), $this->createCache() - ); - $message->addFrom('other@domain', 'Other'); - } - - public function testFromHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('From', (array) 'from@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setFrom('from@domain'); - } - - public function testPersonalNameCanBeUsedInFromAddress() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('From', ['from@domain' => 'Name']); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setFrom('from@domain', 'Name'); - } - - public function testReplyToIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.2. - */ - - $reply = $this->createHeader('Reply-To', ['reply@domain' => 'Name']); - $message = $this->createMessage( - $this->createHeaderSet(['Reply-To' => $reply]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals(['reply@domain' => 'Name'], $message->getReplyTo()); - } - - public function testReplyToIsSetInHeader() - { - $reply = $this->createHeader('Reply-To', ['reply@domain' => 'Name'], - [], false - ); - $reply->shouldReceive('setFieldBodyModel') - ->once() - ->with(['other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['Reply-To' => $reply]), - $this->createEncoder(), $this->createCache() - ); - $message->setReplyTo(['other@domain' => 'Other']); - } - - public function testReplyToIsAddedToHeadersDuringAddReplyTo() - { - $replyTo = $this->createHeader('Reply-To', ['from@domain' => 'Name'], - [], false - ); - $replyTo->shouldReceive('setFieldBodyModel') - ->once() - ->with(['from@domain' => 'Name', 'other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['Reply-To' => $replyTo]), - $this->createEncoder(), $this->createCache() - ); - $message->addReplyTo('other@domain', 'Other'); - } - - public function testReplyToHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Reply-To', (array) 'reply@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setReplyTo('reply@domain'); - } - - public function testNameCanBeUsedInReplyTo() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Reply-To', ['reply@domain' => 'Name']); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setReplyTo('reply@domain', 'Name'); - } - - public function testToIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.3. - */ - - $to = $this->createHeader('To', ['to@domain' => 'Name']); - $message = $this->createMessage( - $this->createHeaderSet(['To' => $to]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals(['to@domain' => 'Name'], $message->getTo()); - } - - public function testToIsSetInHeader() - { - $to = $this->createHeader('To', ['to@domain' => 'Name'], - [], false - ); - $to->shouldReceive('setFieldBodyModel') - ->once() - ->with(['other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['To' => $to]), - $this->createEncoder(), $this->createCache() - ); - $message->setTo(['other@domain' => 'Other']); - } - - public function testToIsAddedToHeadersDuringAddTo() - { - $to = $this->createHeader('To', ['from@domain' => 'Name'], - [], false - ); - $to->shouldReceive('setFieldBodyModel') - ->once() - ->with(['from@domain' => 'Name', 'other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['To' => $to]), - $this->createEncoder(), $this->createCache() - ); - $message->addTo('other@domain', 'Other'); - } - - public function testToHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('To', (array) 'to@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setTo('to@domain'); - } - - public function testNameCanBeUsedInToHeader() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('To', ['to@domain' => 'Name']); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setTo('to@domain', 'Name'); - } - - public function testCcIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.3. - */ - - $cc = $this->createHeader('Cc', ['cc@domain' => 'Name']); - $message = $this->createMessage( - $this->createHeaderSet(['Cc' => $cc]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals(['cc@domain' => 'Name'], $message->getCc()); - } - - public function testCcIsSetInHeader() - { - $cc = $this->createHeader('Cc', ['cc@domain' => 'Name'], - [], false - ); - $cc->shouldReceive('setFieldBodyModel') - ->once() - ->with(['other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['Cc' => $cc]), - $this->createEncoder(), $this->createCache() - ); - $message->setCc(['other@domain' => 'Other']); - } - - public function testCcIsAddedToHeadersDuringAddCc() - { - $cc = $this->createHeader('Cc', ['from@domain' => 'Name'], - [], false - ); - $cc->shouldReceive('setFieldBodyModel') - ->once() - ->with(['from@domain' => 'Name', 'other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['Cc' => $cc]), - $this->createEncoder(), $this->createCache() - ); - $message->addCc('other@domain', 'Other'); - } - - public function testCcHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Cc', (array) 'cc@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setCc('cc@domain'); - } - - public function testNameCanBeUsedInCcHeader() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Cc', ['cc@domain' => 'Name']); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setCc('cc@domain', 'Name'); - } - - public function testBccIsReturnedFromHeader() - { - /* -- RFC 2822, 3.6.3. - */ - - $bcc = $this->createHeader('Bcc', ['bcc@domain' => 'Name']); - $message = $this->createMessage( - $this->createHeaderSet(['Bcc' => $bcc]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals(['bcc@domain' => 'Name'], $message->getBcc()); - } - - public function testBccIsSetInHeader() - { - $bcc = $this->createHeader('Bcc', ['bcc@domain' => 'Name'], - [], false - ); - $bcc->shouldReceive('setFieldBodyModel') - ->once() - ->with(['other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['Bcc' => $bcc]), - $this->createEncoder(), $this->createCache() - ); - $message->setBcc(['other@domain' => 'Other']); - } - - public function testBccIsAddedToHeadersDuringAddBcc() - { - $bcc = $this->createHeader('Bcc', ['from@domain' => 'Name'], - [], false - ); - $bcc->shouldReceive('setFieldBodyModel') - ->once() - ->with(['from@domain' => 'Name', 'other@domain' => 'Other']); - - $message = $this->createMessage( - $this->createHeaderSet(['Bcc' => $bcc]), - $this->createEncoder(), $this->createCache() - ); - $message->addBcc('other@domain', 'Other'); - } - - public function testBccHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Bcc', (array) 'bcc@domain'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setBcc('bcc@domain'); - } - - public function testNameCanBeUsedInBcc() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Bcc', ['bcc@domain' => 'Name']); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setBcc('bcc@domain', 'Name'); - } - - public function testPriorityIsReadFromHeader() - { - $prio = $this->createHeader('X-Priority', '2 (High)'); - $message = $this->createMessage( - $this->createHeaderSet(['X-Priority' => $prio]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals(2, $message->getPriority()); - } - - public function testPriorityIsSetInHeader() - { - $prio = $this->createHeader('X-Priority', '2 (High)', [], false); - $prio->shouldReceive('setFieldBodyModel') - ->once() - ->with('5 (Lowest)'); - - $message = $this->createMessage( - $this->createHeaderSet(['X-Priority' => $prio]), - $this->createEncoder(), $this->createCache() - ); - $message->setPriority($message::PRIORITY_LOWEST); - } - - public function testPriorityHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addTextHeader') - ->once() - ->with('X-Priority', '4 (Low)'); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setPriority($message::PRIORITY_LOW); - } - - public function testReadReceiptAddressReadFromHeader() - { - $rcpt = $this->createHeader('Disposition-Notification-To', - ['chris@swiftmailer.org' => 'Chris'] - ); - $message = $this->createMessage( - $this->createHeaderSet(['Disposition-Notification-To' => $rcpt]), - $this->createEncoder(), $this->createCache() - ); - $this->assertEquals(['chris@swiftmailer.org' => 'Chris'], - $message->getReadReceiptTo() - ); - } - - public function testReadReceiptIsSetInHeader() - { - $rcpt = $this->createHeader('Disposition-Notification-To', [], [], false); - $rcpt->shouldReceive('setFieldBodyModel') - ->once() - ->with('mark@swiftmailer.org'); - - $message = $this->createMessage( - $this->createHeaderSet(['Disposition-Notification-To' => $rcpt]), - $this->createEncoder(), $this->createCache() - ); - $message->setReadReceiptTo('mark@swiftmailer.org'); - } - - public function testReadReceiptHeaderIsAddedIfNoneSet() - { - $headers = $this->createHeaderSet([], false); - $headers->shouldReceive('addMailboxHeader') - ->once() - ->with('Disposition-Notification-To', 'mark@swiftmailer.org'); - $headers->shouldReceive('addMailboxHeader') - ->zeroOrMoreTimes(); - - $message = $this->createMessage($headers, $this->createEncoder(), - $this->createCache() - ); - $message->setReadReceiptTo('mark@swiftmailer.org'); - } - - public function testChildrenCanBeAttached() - { - $child1 = $this->createChild(); - $child2 = $this->createChild(); - - $message = $this->createMessage($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - - $message->attach($child1); - $message->attach($child2); - - $this->assertEquals([$child1, $child2], $message->getChildren()); - } - - public function testChildrenCanBeDetached() - { - $child1 = $this->createChild(); - $child2 = $this->createChild(); - - $message = $this->createMessage($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - - $message->attach($child1); - $message->attach($child2); - - $message->detach($child1); - - $this->assertEquals([$child2], $message->getChildren()); - } - - public function testEmbedAttachesChild() - { - $child = $this->createChild(); - - $message = $this->createMessage($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - - $message->embed($child); - - $this->assertEquals([$child], $message->getChildren()); - } - - public function testEmbedReturnsValidCid() - { - $child = $this->createChild(Swift_Mime_SimpleMimeEntity::LEVEL_RELATED, '', - false - ); - $child->shouldReceive('getId') - ->zeroOrMoreTimes() - ->andReturn('foo@bar'); - - $message = $this->createMessage($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - - $this->assertEquals('cid:foo@bar', $message->embed($child)); - } - - public function testFluidInterface() - { - $child = $this->createChild(); - $message = $this->createMessage($this->createHeaderSet(), - $this->createEncoder(), $this->createCache() - ); - $this->assertSame($message, - $message - ->setContentType('text/plain') - ->setEncoder($this->createEncoder()) - ->setId('foo@bar') - ->setDescription('my description') - ->setMaxLineLength(998) - ->setBody('xx') - ->setBoundary('xyz') - ->setChildren([]) - ->setCharset('iso-8859-1') - ->setFormat('flowed') - ->setDelSp(false) - ->setSubject('subj') - ->setDate(new DateTimeImmutable()) - ->setReturnPath('foo@bar') - ->setSender('foo@bar') - ->setFrom(['x@y' => 'XY']) - ->setReplyTo(['ab@cd' => 'ABCD']) - ->setTo(['chris@site.tld', 'mark@site.tld']) - ->setCc('john@somewhere.tld') - ->setBcc(['one@site', 'two@site' => 'Two']) - ->setPriority($message::PRIORITY_LOW) - ->setReadReceiptTo('a@b') - ->attach($child) - ->detach($child) - ); - } - - //abstract - protected function createEntity($headers, $encoder, $cache) - { - return $this->createMessage($headers, $encoder, $cache); - } - - protected function createMimePart($headers, $encoder, $cache) - { - return $this->createMessage($headers, $encoder, $cache); - } - - private function createMessage($headers, $encoder, $cache) - { - $idGenerator = new Swift_Mime_IdGenerator('example.com'); - - return new Swift_Mime_SimpleMessage($headers, $encoder, $cache, $idGenerator); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php deleted file mode 100644 index 24578ed8e..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php +++ /dev/null @@ -1,12 +0,0 @@ -assertEquals(10, $plugin->getThreshold()); - $plugin->setThreshold(100); - $this->assertEquals(100, $plugin->getThreshold()); - } - - public function testSleepTimeCanBeSetAndFetched() - { - $plugin = new Swift_Plugins_AntiFloodPlugin(10, 5); - $this->assertEquals(5, $plugin->getSleepTime()); - $plugin->setSleepTime(1); - $this->assertEquals(1, $plugin->getSleepTime()); - } - - public function testPluginStopsConnectionAfterThreshold() - { - $transport = $this->createTransport(); - $transport->expects($this->once()) - ->method('start'); - $transport->expects($this->once()) - ->method('stop'); - - $evt = $this->createSendEvent($transport); - - $plugin = new Swift_Plugins_AntiFloodPlugin(10); - for ($i = 0; $i < 12; ++$i) { - $plugin->sendPerformed($evt); - } - } - - public function testPluginCanStopAndStartMultipleTimes() - { - $transport = $this->createTransport(); - $transport->expects($this->exactly(5)) - ->method('start'); - $transport->expects($this->exactly(5)) - ->method('stop'); - - $evt = $this->createSendEvent($transport); - - $plugin = new Swift_Plugins_AntiFloodPlugin(2); - for ($i = 0; $i < 11; ++$i) { - $plugin->sendPerformed($evt); - } - } - - public function testPluginCanSleepDuringRestart() - { - $sleeper = $this->getMockBuilder('Swift_Plugins_Sleeper')->getMock(); - $sleeper->expects($this->once()) - ->method('sleep') - ->with(10); - - $transport = $this->createTransport(); - $transport->expects($this->once()) - ->method('start'); - $transport->expects($this->once()) - ->method('stop'); - - $evt = $this->createSendEvent($transport); - - $plugin = new Swift_Plugins_AntiFloodPlugin(99, 10, $sleeper); - for ($i = 0; $i < 101; ++$i) { - $plugin->sendPerformed($evt); - } - } - - private function createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function createSendEvent($transport) - { - $evt = $this->getMockBuilder('Swift_Events_SendEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getSource') - ->will($this->returnValue($transport)); - $evt->expects($this->any()) - ->method('getTransport') - ->will($this->returnValue($transport)); - - return $evt; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php deleted file mode 100644 index cbacfe276..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/BandwidthMonitorPluginTest.php +++ /dev/null @@ -1,128 +0,0 @@ -monitor = new Swift_Plugins_BandwidthMonitorPlugin(); - } - - public function testBytesOutIncreasesWhenCommandsSent() - { - $evt = $this->createCommandEvent("RCPT TO:\r\n"); - - $this->assertEquals(0, $this->monitor->getBytesOut()); - $this->monitor->commandSent($evt); - $this->assertEquals(23, $this->monitor->getBytesOut()); - $this->monitor->commandSent($evt); - $this->assertEquals(46, $this->monitor->getBytesOut()); - } - - public function testBytesInIncreasesWhenResponsesReceived() - { - $evt = $this->createResponseEvent("250 Ok\r\n"); - - $this->assertEquals(0, $this->monitor->getBytesIn()); - $this->monitor->responseReceived($evt); - $this->assertEquals(8, $this->monitor->getBytesIn()); - $this->monitor->responseReceived($evt); - $this->assertEquals(16, $this->monitor->getBytesIn()); - } - - public function testCountersCanBeReset() - { - $evt = $this->createResponseEvent("250 Ok\r\n"); - - $this->assertEquals(0, $this->monitor->getBytesIn()); - $this->monitor->responseReceived($evt); - $this->assertEquals(8, $this->monitor->getBytesIn()); - $this->monitor->responseReceived($evt); - $this->assertEquals(16, $this->monitor->getBytesIn()); - - $evt = $this->createCommandEvent("RCPT TO:\r\n"); - - $this->assertEquals(0, $this->monitor->getBytesOut()); - $this->monitor->commandSent($evt); - $this->assertEquals(23, $this->monitor->getBytesOut()); - $this->monitor->commandSent($evt); - $this->assertEquals(46, $this->monitor->getBytesOut()); - - $this->monitor->reset(); - - $this->assertEquals(0, $this->monitor->getBytesOut()); - $this->assertEquals(0, $this->monitor->getBytesIn()); - } - - public function testBytesOutIncreasesAccordingToMessageLength() - { - $message = $this->createMessageWithByteCount(6); - $evt = $this->createSendEvent($message); - - $this->assertEquals(0, $this->monitor->getBytesOut()); - $this->monitor->sendPerformed($evt); - $this->assertEquals(6, $this->monitor->getBytesOut()); - $this->monitor->sendPerformed($evt); - $this->assertEquals(12, $this->monitor->getBytesOut()); - } - - private function createSendEvent($message) - { - $evt = $this->getMockBuilder('Swift_Events_SendEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getMessage') - ->will($this->returnValue($message)); - - return $evt; - } - - private function createCommandEvent($command) - { - $evt = $this->getMockBuilder('Swift_Events_CommandEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getCommand') - ->will($this->returnValue($command)); - - return $evt; - } - - private function createResponseEvent($response) - { - $evt = $this->getMockBuilder('Swift_Events_ResponseEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getResponse') - ->will($this->returnValue($response)); - - return $evt; - } - - private function createMessageWithByteCount($bytes) - { - $this->bytes = $bytes; - $msg = $this->getMockBuilder('Swift_Mime_SimpleMessage')->disableOriginalConstructor()->getMock(); - $msg->expects($this->any()) - ->method('toByteStream') - ->will($this->returnCallback([$this, 'write'])); - /* $this->checking(Expectations::create() - -> ignoring($msg)->toByteStream(any()) -> calls(array($this, 'write')) - ); */ - - return $msg; - } - - public function write($is) - { - for ($i = 0; $i < $this->bytes; ++$i) { - $is->write('x'); - } - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php deleted file mode 100644 index 97b1d9586..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/DecoratorPluginTest.php +++ /dev/null @@ -1,284 +0,0 @@ -createMessage( - $this->createHeaders(), - ['zip@button.tld' => 'Zipathon'], - ['chris.corbyn@swiftmailer.org' => 'Chris'], - 'Subject', - 'Hello {name}, you are customer #{id}' - ); - $message->shouldReceive('setBody') - ->once() - ->with('Hello Zip, you are customer #456'); - $message->shouldReceive('setBody') - ->zeroOrMoreTimes(); - - $plugin = $this->createPlugin( - ['zip@button.tld' => ['{name}' => 'Zip', '{id}' => '456']] - ); - - $evt = $this->createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsCanBeAppliedToSameMessageMultipleTimes() - { - $message = $this->createMessage( - $this->createHeaders(), - ['zip@button.tld' => 'Zipathon', 'foo@bar.tld' => 'Foo'], - ['chris.corbyn@swiftmailer.org' => 'Chris'], - 'Subject', - 'Hello {name}, you are customer #{id}' - ); - $message->shouldReceive('setBody') - ->once() - ->with('Hello Zip, you are customer #456'); - $message->shouldReceive('setBody') - ->once() - ->with('Hello {name}, you are customer #{id}'); - $message->shouldReceive('setBody') - ->once() - ->with('Hello Foo, you are customer #123'); - $message->shouldReceive('setBody') - ->zeroOrMoreTimes(); - - $plugin = $this->createPlugin( - [ - 'foo@bar.tld' => ['{name}' => 'Foo', '{id}' => '123'], - 'zip@button.tld' => ['{name}' => 'Zip', '{id}' => '456'], - ] - ); - - $evt = $this->createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsCanBeMadeInHeaders() - { - $headers = $this->createHeaders([ - $returnPathHeader = $this->createHeader('Return-Path', 'foo-{id}@swiftmailer.org'), - $toHeader = $this->createHeader('Subject', 'A message for {name}!'), - ]); - - $message = $this->createMessage( - $headers, - ['zip@button.tld' => 'Zipathon'], - ['chris.corbyn@swiftmailer.org' => 'Chris'], - 'A message for {name}!', - 'Hello {name}, you are customer #{id}' - ); - - $message->shouldReceive('setBody') - ->once() - ->with('Hello Zip, you are customer #456'); - $toHeader->shouldReceive('setFieldBodyModel') - ->once() - ->with('A message for Zip!'); - $returnPathHeader->shouldReceive('setFieldBodyModel') - ->once() - ->with('foo-456@swiftmailer.org'); - $message->shouldReceive('setBody') - ->zeroOrMoreTimes(); - $toHeader->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - $returnPathHeader->shouldReceive('setFieldBodyModel') - ->zeroOrMoreTimes(); - - $plugin = $this->createPlugin( - ['zip@button.tld' => ['{name}' => 'Zip', '{id}' => '456']] - ); - $evt = $this->createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsAreMadeOnSubparts() - { - $part1 = $this->createPart('text/plain', 'Your name is {name}?', '1@x'); - $part2 = $this->createPart('text/html', 'Your name is {name}?', '2@x'); - $message = $this->createMessage( - $this->createHeaders(), - ['zip@button.tld' => 'Zipathon'], - ['chris.corbyn@swiftmailer.org' => 'Chris'], - 'A message for {name}!', - 'Subject' - ); - $message->shouldReceive('getChildren') - ->zeroOrMoreTimes() - ->andReturn([$part1, $part2]); - $part1->shouldReceive('setBody') - ->once() - ->with('Your name is Zip?'); - $part2->shouldReceive('setBody') - ->once() - ->with('Your name is Zip?'); - $part1->shouldReceive('setBody') - ->zeroOrMoreTimes(); - $part2->shouldReceive('setBody') - ->zeroOrMoreTimes(); - - $plugin = $this->createPlugin( - ['zip@button.tld' => ['{name}' => 'Zip', '{id}' => '456']] - ); - - $evt = $this->createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsCanBeTakenFromCustomReplacementsObject() - { - $message = $this->createMessage( - $this->createHeaders(), - ['foo@bar' => 'Foobar', 'zip@zap' => 'Zip zap'], - ['chris.corbyn@swiftmailer.org' => 'Chris'], - 'Subject', - 'Something {a}' - ); - - $replacements = $this->createReplacements(); - - $message->shouldReceive('setBody') - ->once() - ->with('Something b'); - $message->shouldReceive('setBody') - ->once() - ->with('Something c'); - $message->shouldReceive('setBody') - ->zeroOrMoreTimes(); - $replacements->shouldReceive('getReplacementsFor') - ->once() - ->with('foo@bar') - ->andReturn(['{a}' => 'b']); - $replacements->shouldReceive('getReplacementsFor') - ->once() - ->with('zip@zap') - ->andReturn(['{a}' => 'c']); - - $plugin = $this->createPlugin($replacements); - - $evt = $this->createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - - public function testReplacementsWithAMessageWithImmutableDate() - { - $message = (new Swift_Message('subject foo')) - ->setBody('body foo') - ->addTo('somebody@hostname.tld') - ->addFrom('somebody@hostname.tld'); - - $evt = $this->createSendEvent($message); - - $plugin = $this->createPlugin(['somebody@hostname.tld' => ['foo' => 'bar']]); - - $plugin->beforeSendPerformed($evt); - - $this->assertEquals('subject bar', $message->getSubject()); - $this->assertEquals('body bar', $message->getBody()); - } - - private function createMessage($headers, $to = [], $from = null, $subject = null, - $body = null) - { - $message = $this->getMockery('Swift_Mime_SimpleMessage')->shouldIgnoreMissing(); - foreach ($to as $addr => $name) { - $message->shouldReceive('getTo') - ->once() - ->andReturn([$addr => $name]); - } - $message->shouldReceive('getHeaders') - ->zeroOrMoreTimes() - ->andReturn($headers); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn($from); - $message->shouldReceive('getSubject') - ->zeroOrMoreTimes() - ->andReturn($subject); - $message->shouldReceive('getBody') - ->zeroOrMoreTimes() - ->andReturn($body); - - return $message; - } - - private function createPlugin($replacements) - { - return new Swift_Plugins_DecoratorPlugin($replacements); - } - - private function createReplacements() - { - return $this->getMockery('Swift_Plugins_Decorator_Replacements')->shouldIgnoreMissing(); - } - - private function createSendEvent(Swift_Mime_SimpleMessage $message) - { - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $evt->shouldReceive('getMessage') - ->zeroOrMoreTimes() - ->andReturn($message); - - return $evt; - } - - private function createPart($type, $body, $id) - { - $part = $this->getMockery('Swift_Mime_SimpleMimeEntity')->shouldIgnoreMissing(); - $part->shouldReceive('getContentType') - ->zeroOrMoreTimes() - ->andReturn($type); - $part->shouldReceive('getBody') - ->zeroOrMoreTimes() - ->andReturn($body); - $part->shouldReceive('getId') - ->zeroOrMoreTimes() - ->andReturn($id); - - return $part; - } - - private function createHeaders($headers = []) - { - $set = $this->getMockery('Swift_Mime_SimpleHeaderSet')->shouldIgnoreMissing(); - $set->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->andReturn($headers); - - foreach ($headers as $header) { - $set->set($header); - } - - return $set; - } - - private function createHeader($name, $body = '') - { - $header = $this->getMockery('Swift_Mime_Header')->shouldIgnoreMissing(); - $header->shouldReceive('getFieldName') - ->zeroOrMoreTimes() - ->andReturn($name); - $header->shouldReceive('getFieldBodyModel') - ->zeroOrMoreTimes() - ->andReturn($body); - - return $header; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php deleted file mode 100644 index d66021cb5..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/LoggerPluginTest.php +++ /dev/null @@ -1,188 +0,0 @@ -createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with('foo'); - - $plugin = $this->createPlugin($logger); - $plugin->add('foo'); - } - - public function testLoggerDelegatesDumpingEntries() - { - $logger = $this->createLogger(); - $logger->expects($this->once()) - ->method('dump') - ->will($this->returnValue('foobar')); - - $plugin = $this->createPlugin($logger); - $this->assertEquals('foobar', $plugin->dump()); - } - - public function testLoggerDelegatesClearingEntries() - { - $logger = $this->createLogger(); - $logger->expects($this->once()) - ->method('clear'); - - $plugin = $this->createPlugin($logger); - $plugin->clear(); - } - - public function testCommandIsSentToLogger() - { - $evt = $this->createCommandEvent("foo\r\n"); - $logger = $this->createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with(static::regExp('~foo\r\n~')); - - $plugin = $this->createPlugin($logger); - $plugin->commandSent($evt); - } - - public function testResponseIsSentToLogger() - { - $evt = $this->createResponseEvent("354 Go ahead\r\n"); - $logger = $this->createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with(static::regExp('~354 Go ahead\r\n~')); - - $plugin = $this->createPlugin($logger); - $plugin->responseReceived($evt); - } - - public function testTransportBeforeStartChangeIsSentToLogger() - { - $evt = $this->createTransportChangeEvent(); - $logger = $this->createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->createPlugin($logger); - $plugin->beforeTransportStarted($evt); - } - - public function testTransportStartChangeIsSentToLogger() - { - $evt = $this->createTransportChangeEvent(); - $logger = $this->createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->createPlugin($logger); - $plugin->transportStarted($evt); - } - - public function testTransportStopChangeIsSentToLogger() - { - $evt = $this->createTransportChangeEvent(); - $logger = $this->createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->createPlugin($logger); - $plugin->transportStopped($evt); - } - - public function testTransportBeforeStopChangeIsSentToLogger() - { - $evt = $this->createTransportChangeEvent(); - $logger = $this->createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->createPlugin($logger); - $plugin->beforeTransportStopped($evt); - } - - public function testExceptionsArePassedToDelegateAndLeftToBubbleUp() - { - $transport = $this->createTransport(); - $evt = $this->createTransportExceptionEvent(); - $logger = $this->createLogger(); - $logger->expects($this->once()) - ->method('add') - ->with($this->anything()); - - $plugin = $this->createPlugin($logger); - try { - $plugin->exceptionThrown($evt); - $this->fail('Exception should bubble up.'); - } catch (Swift_TransportException $ex) { - } - } - - private function createLogger() - { - return $this->getMockBuilder('Swift_Plugins_Logger')->getMock(); - } - - private function createPlugin($logger) - { - return new Swift_Plugins_LoggerPlugin($logger); - } - - private function createCommandEvent($command) - { - $evt = $this->getMockBuilder('Swift_Events_CommandEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getCommand') - ->will($this->returnValue($command)); - - return $evt; - } - - private function createResponseEvent($response) - { - $evt = $this->getMockBuilder('Swift_Events_ResponseEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getResponse') - ->will($this->returnValue($response)); - - return $evt; - } - - private function createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function createTransportChangeEvent() - { - $evt = $this->getMockBuilder('Swift_Events_TransportChangeEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getSource') - ->will($this->returnValue($this->createTransport())); - - return $evt; - } - - public function createTransportExceptionEvent() - { - $evt = $this->getMockBuilder('Swift_Events_TransportExceptionEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getException') - ->will($this->returnValue(new Swift_TransportException(''))); - - return $evt; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php deleted file mode 100644 index 48c1b075a..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/ArrayLoggerTest.php +++ /dev/null @@ -1,65 +0,0 @@ -add(">> Foo\r\n"); - $this->assertEquals(">> Foo\r\n", $logger->dump()); - } - - public function testAddingMultipleEntriesDumpsMultipleLines() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $logger->add(">> FOO\r\n"); - $logger->add("<< 502 That makes no sense\r\n"); - $logger->add(">> RSET\r\n"); - $logger->add("<< 250 OK\r\n"); - - $this->assertEquals( - ">> FOO\r\n".PHP_EOL. - "<< 502 That makes no sense\r\n".PHP_EOL. - ">> RSET\r\n".PHP_EOL. - "<< 250 OK\r\n", - $logger->dump() - ); - } - - public function testLogCanBeCleared() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(); - $logger->add(">> FOO\r\n"); - $logger->add("<< 502 That makes no sense\r\n"); - $logger->add(">> RSET\r\n"); - $logger->add("<< 250 OK\r\n"); - - $this->assertEquals( - ">> FOO\r\n".PHP_EOL. - "<< 502 That makes no sense\r\n".PHP_EOL. - ">> RSET\r\n".PHP_EOL. - "<< 250 OK\r\n", - $logger->dump() - ); - - $logger->clear(); - - $this->assertEquals('', $logger->dump()); - } - - public function testLengthCanBeTruncated() - { - $logger = new Swift_Plugins_Loggers_ArrayLogger(2); - $logger->add(">> FOO\r\n"); - $logger->add("<< 502 That makes no sense\r\n"); - $logger->add(">> RSET\r\n"); - $logger->add("<< 250 OK\r\n"); - - $this->assertEquals( - ">> RSET\r\n".PHP_EOL. - "<< 250 OK\r\n", - $logger->dump(), - '%s: Log should be truncated to last 2 entries' - ); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php deleted file mode 100644 index c43660da1..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Loggers/EchoLoggerTest.php +++ /dev/null @@ -1,24 +0,0 @@ -add('>> Foo'); - $data = ob_get_clean(); - - $this->assertEquals('>> Foo'.PHP_EOL, $data); - } - - public function testAddingEntryDumpsEscapedLineWithHtml() - { - $logger = new Swift_Plugins_Loggers_EchoLogger(true); - ob_start(); - $logger->add('>> Foo'); - $data = ob_get_clean(); - - $this->assertEquals('>> Foo
'.PHP_EOL, $data); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php deleted file mode 100644 index cf88a4e7f..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/PopBeforeSmtpPluginTest.php +++ /dev/null @@ -1,101 +0,0 @@ -createConnection(); - $connection->expects($this->once()) - ->method('connect'); - - $plugin = $this->createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - - $transport = $this->createTransport(); - $evt = $this->createTransportChangeEvent($transport); - - $plugin->beforeTransportStarted($evt); - } - - public function testPluginDisconnectsFromPop3HostBeforeTransportStarts() - { - $connection = $this->createConnection(); - $connection->expects($this->once()) - ->method('disconnect'); - - $plugin = $this->createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - - $transport = $this->createTransport(); - $evt = $this->createTransportChangeEvent($transport); - - $plugin->beforeTransportStarted($evt); - } - - public function testPluginDoesNotConnectToSmtpIfBoundToDifferentTransport() - { - $connection = $this->createConnection(); - $connection->expects($this->never()) - ->method('disconnect'); - $connection->expects($this->never()) - ->method('connect'); - - $smtp = $this->createTransport(); - - $plugin = $this->createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - $plugin->bindSmtp($smtp); - - $transport = $this->createTransport(); - $evt = $this->createTransportChangeEvent($transport); - - $plugin->beforeTransportStarted($evt); - } - - public function testPluginCanBindToSpecificTransport() - { - $connection = $this->createConnection(); - $connection->expects($this->once()) - ->method('connect'); - - $smtp = $this->createTransport(); - - $plugin = $this->createPlugin('pop.host.tld', 110); - $plugin->setConnection($connection); - $plugin->bindSmtp($smtp); - - $evt = $this->createTransportChangeEvent($smtp); - - $plugin->beforeTransportStarted($evt); - } - - private function createTransport() - { - return $this->getMockBuilder('Swift_Transport')->getMock(); - } - - private function createTransportChangeEvent($transport) - { - $evt = $this->getMockBuilder('Swift_Events_TransportChangeEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getSource') - ->will($this->returnValue($transport)); - $evt->expects($this->any()) - ->method('getTransport') - ->will($this->returnValue($transport)); - - return $evt; - } - - public function createConnection() - { - return $this->getMockBuilder('Swift_Plugins_Pop_Pop3Connection')->getMock(); - } - - public function createPlugin($host, $port, $crypto = null) - { - return new Swift_Plugins_PopBeforeSmtpPlugin($host, $port, $crypto); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php deleted file mode 100644 index 0ad638670..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/RedirectingPluginTest.php +++ /dev/null @@ -1,183 +0,0 @@ -assertEquals('fabien@example.com', $plugin->getRecipient()); - $plugin->setRecipient('chris@example.com'); - $this->assertEquals('chris@example.com', $plugin->getRecipient()); - } - - public function testPluginChangesRecipients() - { - $message = (new Swift_Message()) - ->setSubject('...') - ->setFrom(['john@example.com' => 'John Doe']) - ->setTo($to = [ - 'fabien-to@example.com' => 'Fabien (To)', - 'chris-to@example.com' => 'Chris (To)', - ]) - ->setCc($cc = [ - 'fabien-cc@example.com' => 'Fabien (Cc)', - 'chris-cc@example.com' => 'Chris (Cc)', - ]) - ->setBcc($bcc = [ - 'fabien-bcc@example.com' => 'Fabien (Bcc)', - 'chris-bcc@example.com' => 'Chris (Bcc)', - ]) - ->setBody('...') - ; - - $plugin = new Swift_Plugins_RedirectingPlugin('god@example.com'); - - $evt = $this->createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - - $this->assertEquals($message->getTo(), ['god@example.com' => '']); - $this->assertEquals($message->getCc(), []); - $this->assertEquals($message->getBcc(), []); - - $plugin->sendPerformed($evt); - - $this->assertEquals($message->getTo(), $to); - $this->assertEquals($message->getCc(), $cc); - $this->assertEquals($message->getBcc(), $bcc); - } - - public function testPluginRespectsUnsetToList() - { - $message = (new Swift_Message()) - ->setSubject('...') - ->setFrom(['john@example.com' => 'John Doe']) - ->setCc($cc = [ - 'fabien-cc@example.com' => 'Fabien (Cc)', - 'chris-cc@example.com' => 'Chris (Cc)', - ]) - ->setBcc($bcc = [ - 'fabien-bcc@example.com' => 'Fabien (Bcc)', - 'chris-bcc@example.com' => 'Chris (Bcc)', - ]) - ->setBody('...') - ; - - $plugin = new Swift_Plugins_RedirectingPlugin('god@example.com'); - - $evt = $this->createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - - $this->assertEquals($message->getTo(), ['god@example.com' => '']); - $this->assertEquals($message->getCc(), []); - $this->assertEquals($message->getBcc(), []); - - $plugin->sendPerformed($evt); - - $this->assertEquals($message->getTo(), []); - $this->assertEquals($message->getCc(), $cc); - $this->assertEquals($message->getBcc(), $bcc); - } - - public function testPluginRespectsAWhitelistOfPatterns() - { - $message = (new Swift_Message()) - ->setSubject('...') - ->setFrom(['john@example.com' => 'John Doe']) - ->setTo($to = [ - 'fabien-to@example.com' => 'Fabien (To)', - 'chris-to@example.com' => 'Chris (To)', - 'lars-to@internal.com' => 'Lars (To)', - ]) - ->setCc($cc = [ - 'fabien-cc@example.com' => 'Fabien (Cc)', - 'chris-cc@example.com' => 'Chris (Cc)', - 'lars-cc@internal.org' => 'Lars (Cc)', - ]) - ->setBcc($bcc = [ - 'fabien-bcc@example.com' => 'Fabien (Bcc)', - 'chris-bcc@example.com' => 'Chris (Bcc)', - 'john-bcc@example.org' => 'John (Bcc)', - ]) - ->setBody('...') - ; - - $recipient = 'god@example.com'; - $patterns = ['/^.*@internal.[a-z]+$/', '/^john-.*$/']; - - $plugin = new Swift_Plugins_RedirectingPlugin($recipient, $patterns); - - $this->assertEquals($recipient, $plugin->getRecipient()); - $this->assertEquals($plugin->getWhitelist(), $patterns); - - $evt = $this->createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - - $this->assertEquals($message->getTo(), ['lars-to@internal.com' => 'Lars (To)', 'god@example.com' => null]); - $this->assertEquals($message->getCc(), ['lars-cc@internal.org' => 'Lars (Cc)']); - $this->assertEquals($message->getBcc(), ['john-bcc@example.org' => 'John (Bcc)']); - - $plugin->sendPerformed($evt); - - $this->assertEquals($message->getTo(), $to); - $this->assertEquals($message->getCc(), $cc); - $this->assertEquals($message->getBcc(), $bcc); - } - - public function testArrayOfRecipientsCanBeExplicitlyDefined() - { - $message = (new Swift_Message()) - ->setSubject('...') - ->setFrom(['john@example.com' => 'John Doe']) - ->setTo([ - 'fabien@example.com' => 'Fabien', - 'chris@example.com' => 'Chris (To)', - 'lars-to@internal.com' => 'Lars (To)', - ]) - ->setCc([ - 'fabien@example.com' => 'Fabien', - 'chris-cc@example.com' => 'Chris (Cc)', - 'lars-cc@internal.org' => 'Lars (Cc)', - ]) - ->setBcc([ - 'fabien@example.com' => 'Fabien', - 'chris-bcc@example.com' => 'Chris (Bcc)', - 'john-bcc@example.org' => 'John (Bcc)', - ]) - ->setBody('...') - ; - - $recipients = ['god@example.com', 'fabien@example.com']; - $patterns = ['/^.*@internal.[a-z]+$/']; - - $plugin = new Swift_Plugins_RedirectingPlugin($recipients, $patterns); - - $evt = $this->createSendEvent($message); - - $plugin->beforeSendPerformed($evt); - - $this->assertEquals( - $message->getTo(), - ['fabien@example.com' => 'Fabien', 'lars-to@internal.com' => 'Lars (To)', 'god@example.com' => null] - ); - $this->assertEquals( - $message->getCc(), - ['fabien@example.com' => 'Fabien', 'lars-cc@internal.org' => 'Lars (Cc)'] - ); - $this->assertEquals($message->getBcc(), ['fabien@example.com' => 'Fabien']); - } - - private function createSendEvent(Swift_Mime_SimpleMessage $message) - { - $evt = $this->getMockBuilder('Swift_Events_SendEvent') - ->disableOriginalConstructor() - ->getMock(); - $evt->expects($this->any()) - ->method('getMessage') - ->will($this->returnValue($message)); - - return $evt; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php deleted file mode 100644 index 19238f837..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ReporterPluginTest.php +++ /dev/null @@ -1,86 +0,0 @@ -createMessage(); - $evt = $this->createSendEvent(); - $reporter = $this->createReporter(); - - $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(['foo@bar.tld' => 'Foo']); - $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); - $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn([]); - $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - public function testReportingFailedTo() - { - $message = $this->createMessage(); - $evt = $this->createSendEvent(); - $reporter = $this->createReporter(); - - $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(['foo@bar.tld' => 'Foo', 'zip@button' => 'Zip']); - $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); - $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(['zip@button']); - $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); - $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - public function testReportingFailedCc() - { - $message = $this->createMessage(); - $evt = $this->createSendEvent(); - $reporter = $this->createReporter(); - - $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(['foo@bar.tld' => 'Foo']); - $message->shouldReceive('getCc')->zeroOrMoreTimes()->andReturn(['zip@button' => 'Zip', 'test@test.com' => 'Test']); - $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); - $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(['zip@button']); - $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); - $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); - $reporter->shouldReceive('notify')->once()->with($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - public function testReportingFailedBcc() - { - $message = $this->createMessage(); - $evt = $this->createSendEvent(); - $reporter = $this->createReporter(); - - $message->shouldReceive('getTo')->zeroOrMoreTimes()->andReturn(['foo@bar.tld' => 'Foo']); - $message->shouldReceive('getBcc')->zeroOrMoreTimes()->andReturn(['zip@button' => 'Zip', 'test@test.com' => 'Test']); - $evt->shouldReceive('getMessage')->zeroOrMoreTimes()->andReturn($message); - $evt->shouldReceive('getFailedRecipients')->zeroOrMoreTimes()->andReturn(['zip@button']); - $reporter->shouldReceive('notify')->once()->with($message, 'foo@bar.tld', Swift_Plugins_Reporter::RESULT_PASS); - $reporter->shouldReceive('notify')->once()->with($message, 'zip@button', Swift_Plugins_Reporter::RESULT_FAIL); - $reporter->shouldReceive('notify')->once()->with($message, 'test@test.com', Swift_Plugins_Reporter::RESULT_PASS); - - $plugin = new Swift_Plugins_ReporterPlugin($reporter); - $plugin->sendPerformed($evt); - } - - private function createMessage() - { - return $this->getMockery('Swift_Mime_SimpleMessage')->shouldIgnoreMissing(); - } - - private function createSendEvent() - { - return $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - } - - private function createReporter() - { - return $this->getMockery('Swift_Plugins_Reporter')->shouldIgnoreMissing(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php deleted file mode 100644 index d5a1c9ce9..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HitReporterTest.php +++ /dev/null @@ -1,64 +0,0 @@ -hitReporter = new Swift_Plugins_Reporters_HitReporter(); - $this->message = $this->getMockBuilder('Swift_Mime_SimpleMessage')->disableOriginalConstructor()->getMock(); - } - - public function testReportingFail() - { - $this->hitReporter->notify($this->message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->assertEquals(['foo@bar.tld'], - $this->hitReporter->getFailedRecipients() - ); - } - - public function testMultipleReports() - { - $this->hitReporter->notify($this->message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->hitReporter->notify($this->message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->assertEquals(['foo@bar.tld', 'zip@button'], - $this->hitReporter->getFailedRecipients() - ); - } - - public function testReportingPassIsIgnored() - { - $this->hitReporter->notify($this->message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->hitReporter->notify($this->message, 'zip@button', - Swift_Plugins_Reporter::RESULT_PASS - ); - $this->assertEquals(['foo@bar.tld'], - $this->hitReporter->getFailedRecipients() - ); - } - - public function testBufferCanBeCleared() - { - $this->hitReporter->notify($this->message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->hitReporter->notify($this->message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $this->assertEquals(['foo@bar.tld', 'zip@button'], - $this->hitReporter->getFailedRecipients() - ); - $this->hitReporter->clear(); - $this->assertEquals([], $this->hitReporter->getFailedRecipients()); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php deleted file mode 100644 index 6b86cfe24..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/Reporters/HtmlReporterTest.php +++ /dev/null @@ -1,54 +0,0 @@ -html = new Swift_Plugins_Reporters_HtmlReporter(); - $this->message = $this->getMockBuilder('Swift_Mime_SimpleMessage')->disableOriginalConstructor()->getMock(); - } - - public function testReportingPass() - { - ob_start(); - $this->html->notify($this->message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_PASS - ); - $html = ob_get_clean(); - - $this->assertRegExp('~ok|pass~i', $html, '%s: Reporter should indicate pass'); - $this->assertRegExp('~foo@bar\.tld~', $html, '%s: Reporter should show address'); - } - - public function testReportingFail() - { - ob_start(); - $this->html->notify($this->message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $html = ob_get_clean(); - - $this->assertRegExp('~fail~i', $html, '%s: Reporter should indicate fail'); - $this->assertRegExp('~zip@button~', $html, '%s: Reporter should show address'); - } - - public function testMultipleReports() - { - ob_start(); - $this->html->notify($this->message, 'foo@bar.tld', - Swift_Plugins_Reporter::RESULT_PASS - ); - $this->html->notify($this->message, 'zip@button', - Swift_Plugins_Reporter::RESULT_FAIL - ); - $html = ob_get_clean(); - - $this->assertRegExp('~ok|pass~i', $html, '%s: Reporter should indicate pass'); - $this->assertRegExp('~foo@bar\.tld~', $html, '%s: Reporter should show address'); - $this->assertRegExp('~fail~i', $html, '%s: Reporter should indicate fail'); - $this->assertRegExp('~zip@button~', $html, '%s: Reporter should show address'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php deleted file mode 100644 index e35dcc8dc..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Plugins/ThrottlerPluginTest.php +++ /dev/null @@ -1,102 +0,0 @@ -createSleeper(); - $timer = $this->createTimer(); - - //10MB/min - $plugin = new Swift_Plugins_ThrottlerPlugin( - 10000000, Swift_Plugins_ThrottlerPlugin::BYTES_PER_MINUTE, - $sleeper, $timer - ); - - $timer->shouldReceive('getTimestamp')->once()->andReturn(0); - $timer->shouldReceive('getTimestamp')->once()->andReturn(1); //expected 0.6 - $timer->shouldReceive('getTimestamp')->once()->andReturn(1); //expected 1.2 (sleep 1) - $timer->shouldReceive('getTimestamp')->once()->andReturn(2); //expected 1.8 - $timer->shouldReceive('getTimestamp')->once()->andReturn(2); //expected 2.4 (sleep 1) - $sleeper->shouldReceive('sleep')->twice()->with(1); - - //10,000,000 bytes per minute - //100,000 bytes per email - - // .: (10,000,000/100,000)/60 emails per second = 1.667 emais/sec - - $message = $this->createMessageWithByteCount(100000); //100KB - - $evt = $this->createSendEvent($message); - - for ($i = 0; $i < 5; ++$i) { - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - } - - public function testMessagesPerMinuteThrottling() - { - $sleeper = $this->createSleeper(); - $timer = $this->createTimer(); - - //60/min - $plugin = new Swift_Plugins_ThrottlerPlugin( - 60, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE, - $sleeper, $timer - ); - - $timer->shouldReceive('getTimestamp')->once()->andReturn(0); - $timer->shouldReceive('getTimestamp')->once()->andReturn(0); //expected 1 (sleep 1) - $timer->shouldReceive('getTimestamp')->once()->andReturn(2); //expected 2 - $timer->shouldReceive('getTimestamp')->once()->andReturn(2); //expected 3 (sleep 1) - $timer->shouldReceive('getTimestamp')->once()->andReturn(4); //expected 4 - $sleeper->shouldReceive('sleep')->twice()->with(1); - - //60 messages per minute - //1 message per second - - $message = $this->createMessageWithByteCount(10); - - $evt = $this->createSendEvent($message); - - for ($i = 0; $i < 5; ++$i) { - $plugin->beforeSendPerformed($evt); - $plugin->sendPerformed($evt); - } - } - - private function createSleeper() - { - return $this->getMockery('Swift_Plugins_Sleeper'); - } - - private function createTimer() - { - return $this->getMockery('Swift_Plugins_Timer'); - } - - private function createMessageWithByteCount($bytes) - { - $msg = $this->getMockery('Swift_Mime_SimpleMessage'); - $msg->shouldReceive('toByteStream') - ->zeroOrMoreTimes() - ->andReturnUsing(function ($is) use ($bytes) { - for ($i = 0; $i < $bytes; ++$i) { - $is->write('x'); - } - }); - - return $msg; - } - - private function createSendEvent($message) - { - $evt = $this->getMockery('Swift_Events_SendEvent'); - $evt->shouldReceive('getMessage') - ->zeroOrMoreTimes() - ->andReturn($message); - - return $evt; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/DKIMSignerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/DKIMSignerTest.php deleted file mode 100644 index 1d5f957fa..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/DKIMSignerTest.php +++ /dev/null @@ -1,220 +0,0 @@ -createHeaders(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - /* @var $signer Swift_Signers_HeaderSigner */ - $altered = $signer->getAlteredHeaders(); - $signer->reset(); - // Headers - $signer->setHeaders($headers); - // Body - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - // Signing - $signer->addSignature($headers); - } - - // SHA1 Signing - public function testSigningSHA1() - { - $headerSet = $this->createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha1'); - $signer->setSignatureTimestamp('1299879181'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(['DKIM-Signature'], $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha1; bh=wlbYcY9O9OPInGJ4D0E/rGsvMLE=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; t=1299879181; b=RMSNelzM2O5MAAnMjT3G3/VF36S3DGJXoPCXR001F1WDReu0prGphWjuzK/m6V1pwqQL8cCNg Hi74mTx2bvyAvmkjvQtJf1VMUOCc9WHGcm1Yec66I3ZWoNMGSWZ1EKAm2CtTzyG0IFw4ml9DI wSkyAFxlgicckDD6FibhqwX4w='); - } - - // SHA256 Signing - public function testSigning256() - { - $headerSet = $this->createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha256'); - $signer->setSignatureTimestamp('1299879181'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(['DKIM-Signature'], $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha256; bh=f+W+hu8dIhf2VAni89o8lF6WKTXi7nViA4RrMdpD5/U=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; t=1299879181; b=jqPmieHzF5vR9F4mXCAkowuphpO4iJ8IAVuioh1BFZ3VITXZj5jlOFxULJMBiiApm2keJirnh u4mzogj444QkpT3lJg8/TBGAYQPdcvkG3KC0jdyN6QpSgpITBJG2BwWa+keXsv2bkQgLRAzNx qRhP45vpHCKun0Tg9LrwW/KCg='); - } - - // Relaxed/Relaxed Hash Signing - public function testSigningRelaxedRelaxed256() - { - $headerSet = $this->createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha256'); - $signer->setSignatureTimestamp('1299879181'); - $signer->setBodyCanon('relaxed'); - $signer->setHeaderCanon('relaxed'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(['DKIM-Signature'], $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha256; bh=f+W+hu8dIhf2VAni89o8lF6WKTXi7nViA4RrMdpD5/U=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; c=relaxed/relaxed; t=1299879181; b=gzOI+PX6HpZKQFzwwmxzcVJsyirdLXOS+4pgfCpVHQIdqYusKLrhlLeFBTNoz75HrhNvGH6T0 Rt3w5aTqkrWfUuAEYt0Ns14GowLM7JojaFN+pZ4eYnRB3CBBgW6fee4NEMD5WPca3uS09tr1E 10RYh9ILlRtl+84sovhx5id3Y='); - } - - // Relaxed/Simple Hash Signing - public function testSigningRelaxedSimple256() - { - $headerSet = $this->createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha256'); - $signer->setSignatureTimestamp('1299879181'); - $signer->setHeaderCanon('relaxed'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(['DKIM-Signature'], $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha256; bh=f+W+hu8dIhf2VAni89o8lF6WKTXi7nViA4RrMdpD5/U=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; c=relaxed; t=1299879181; b=dLPJNec5v81oelyzGOY0qPqTlGnQeNfUNBOrV/JKbStr3NqWGI9jH4JAe2YvO2V32lfPNoby1 4MMzZ6EPkaZkZDDSPa+53YbCPQAlqiD9QZZIUe2UNM33HN8yAMgiWEF5aP7MbQnxeVZMfVLEl 9S8qOImu+K5JZqhQQTL0dgLwA='); - } - - // Simple/Relaxed Hash Signing - public function testSigningSimpleRelaxed256() - { - $headerSet = $this->createHeaderSet(); - $messageContent = 'Hello World'; - $signer = new Swift_Signers_DKIMSigner(file_get_contents(dirname(dirname(dirname(__DIR__))).'/_samples/dkim/dkim.test.priv'), 'dummy.nxdomain.be', 'dummySelector'); - $signer->setHashAlgorithm('rsa-sha256'); - $signer->setSignatureTimestamp('1299879181'); - $signer->setBodyCanon('relaxed'); - $altered = $signer->getAlteredHeaders(); - $this->assertEquals(['DKIM-Signature'], $altered); - $signer->reset(); - $signer->setHeaders($headerSet); - $this->assertFalse($headerSet->has('DKIM-Signature')); - $signer->startBody(); - $signer->write($messageContent); - $signer->endBody(); - $signer->addSignature($headerSet); - $this->assertTrue($headerSet->has('DKIM-Signature')); - $dkim = $headerSet->getAll('DKIM-Signature'); - $sig = reset($dkim); - $this->assertEquals($sig->getValue(), 'v=1; a=rsa-sha256; bh=f+W+hu8dIhf2VAni89o8lF6WKTXi7nViA4RrMdpD5/U=; d=dummy.nxdomain.be; h=; i=@dummy.nxdomain.be; s=dummySelector; c=simple/relaxed; t=1299879181; b=M5eomH/zamyzix9kOes+6YLzQZxuJdBP4x3nP9zF2N26eMLG2/cBKbnNyqiOTDhJdYfWPbLIa 1CWnjST0j5p4CpeOkGYuiE+M4TWEZwhRmRWootlPO3Ii6XpbBJKFk1o9zviS7OmXblUUE4aqb yRSIMDhtLdCK5GlaCneFLN7RQ='); - } - - private function createHeaderSet() - { - $cache = new Swift_KeyCache_ArrayKeyCache(new Swift_KeyCache_SimpleKeyCacheInputStream()); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder(new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder(new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')); - $emailValidator = new EmailValidator(); - $headers = new Swift_Mime_SimpleHeaderSet(new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $emailValidator)); - - return $headers; - } - - /** - * @return Swift_Mime_Headers - */ - private function createHeaders() - { - $x = 0; - $cache = new Swift_KeyCache_ArrayKeyCache(new Swift_KeyCache_SimpleKeyCacheInputStream()); - $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); - $contentEncoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder(); - - $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder(new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')); - $paramEncoder = new Swift_Encoder_Rfc2231Encoder(new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8')); - $emailValidator = new EmailValidator(); - $headerFactory = new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $emailValidator); - $headers = $this->getMockery('Swift_Mime_SimpleHeaderSet'); - - $headers->shouldReceive('listAll') - ->zeroOrMoreTimes() - ->andReturn(['From', 'To', 'Date', 'Subject']); - $headers->shouldReceive('has') - ->zeroOrMoreTimes() - ->with('From') - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('From') - ->andReturn([$headerFactory->createMailboxHeader('From', 'test@test.test')]); - $headers->shouldReceive('has') - ->zeroOrMoreTimes() - ->with('To') - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('To') - ->andReturn([$headerFactory->createMailboxHeader('To', 'test@test.test')]); - $headers->shouldReceive('has') - ->zeroOrMoreTimes() - ->with('Date') - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('Date') - ->andReturn([$headerFactory->createTextHeader('Date', 'Fri, 11 Mar 2011 20:56:12 +0000 (GMT)')]); - $headers->shouldReceive('has') - ->zeroOrMoreTimes() - ->with('Subject') - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('Subject') - ->andReturn([$headerFactory->createTextHeader('Subject', 'Foo Bar Text Message')]); - $headers->shouldReceive('addTextHeader') - ->zeroOrMoreTimes() - ->with('DKIM-Signature', \Mockery::any()) - ->andReturn(true); - $headers->shouldReceive('getAll') - ->zeroOrMoreTimes() - ->with('DKIM-Signature') - ->andReturn([$headerFactory->createTextHeader('DKIM-Signature', 'Foo Bar Text Message')]); - - return $headers; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/OpenDKIMSignerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/OpenDKIMSignerTest.php deleted file mode 100644 index ce99bc638..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/OpenDKIMSignerTest.php +++ /dev/null @@ -1,45 +0,0 @@ -markTestSkipped( - 'Need OpenDKIM extension run these tests.' - ); - } - } - - public function testBasicSigningHeaderManipulation() - { - } - - // Default Signing - public function testSigningDefaults() - { - } - - // SHA256 Signing - public function testSigning256() - { - } - - // Relaxed/Relaxed Hash Signing - public function testSigningRelaxedRelaxed256() - { - } - - // Relaxed/Simple Hash Signing - public function testSigningRelaxedSimple256() - { - } - - // Simple/Relaxed Hash Signing - public function testSigningSimpleRelaxed256() - { - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/SMimeSignerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/SMimeSignerTest.php deleted file mode 100644 index 932e48628..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Signers/SMimeSignerTest.php +++ /dev/null @@ -1,653 +0,0 @@ -replacementFactory = Swift_DependencyContainer::getInstance() - ->lookup('transport.replacementfactory'); - - $this->samplesDir = str_replace('\\', '/', realpath(__DIR__.'/../../../_samples/')).'/'; - } - - public function testUnSignedMessage() - { - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself'); - - $this->assertEquals('Here is the message itself', $message->getBody()); - } - - public function testSignedMessage() - { - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself'); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key'); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<assertValidVerify($expectedBody, $messageStream); - unset($messageStream); - } - - public function testSignedMessageWithFullyWrappedMessage() - { - $message = (new Swift_Message('Middle-out compression secrets')) - ->setFrom(['richard@piedpiper.com' => 'Richard Hendricks']) - ->setTo(['jared@piedpiper.com' => 'Jared Dunn']) - ->setBody('Here goes the entire algorithm...'); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key'); - - // Tell the signer to wrap the full MIME message - $signer->setWrapFullMessage(true); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = << -Date: .* -Subject: Middle-out compression secrets -From: Richard Hendricks -To: Jared Dunn -MIME-Version: 1.0 -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: quoted-printable - -Here goes the entire algorithm... ---$boundary -Content-Type: application/(x\-)?pkcs7-signature; name="smime\.p7s" -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="smime\.p7s" - -(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2}) - ---$boundary-- -OEL; - $this->assertValidVerify($expectedBody, $messageStream); - unset($messageStream); - } - - public function testSignedMessageExtraCerts() - { - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself'); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign2.crt', $this->samplesDir.'smime/sign2.key', PKCS7_DETACHED, $this->samplesDir.'smime/intermediate.crt'); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<assertValidVerify($expectedBody, $messageStream); - unset($messageStream); - } - - public function testSignedMessageBinary() - { - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself'); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key', PKCS7_BINARY); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!preg_match('#^application/(x\-)?pkcs7-mime; smime-type=signed\-data;#', $headers['content-type'])) { - $this->fail('Content-type does not match.'); - - return false; - } - - $this->assertEquals($headers['content-transfer-encoding'], 'base64'); - $this->assertEquals($headers['content-disposition'], 'attachment; filename="smime.p7m"'); - - $expectedBody = '(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})'; - - $messageStreamClean = $this->newFilteredStream(); - - $this->assertValidVerify($expectedBody, $messageStream); - unset($messageStreamClean, $messageStream); - } - - public function testSignedMessageWithAttachments() - { - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself'); - - $message->attach(Swift_Attachment::fromPath($this->samplesDir.'/files/textfile.zip')); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key'); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<assertValidVerify($expectedBody, $messageStream); - unset($messageStream); - } - - public function testEncryptedMessage() - { - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself'); - - $originalMessage = $this->cleanMessage($message->toString()); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setEncryptCertificate($this->samplesDir.'smime/encrypt.crt'); - $message->attachSigner($signer); - - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!preg_match('#^application/(x\-)?pkcs7-mime; smime-type=enveloped\-data;#', $headers['content-type'])) { - $this->fail('Content-type does not match.'); - - return false; - } - - $expectedBody = '(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})'; - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStream->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt.crt', ['file://'.$this->samplesDir.'smime/encrypt.key', 'swift'])) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $this->assertEquals($originalMessage, $decryptedMessageStream->getContent()); - unset($decryptedMessageStream, $messageStream); - } - - public function testEncryptedMessageWithFullyWrappedMessage() - { - $message = (new Swift_Message('Middle-out compression secrets')) - ->setFrom(['richard@piedpiper.com' => 'Richard Hendricks']) - ->setTo(['jared@piedpiper.com' => 'Jared Dunn']) - ->setBody('Here goes the entire algorithm...'); - - $originalMessage = $message->toString(); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setEncryptCertificate($this->samplesDir.'smime/encrypt.crt'); - $signer->setWrapFullMessage(true); - $message->attachSigner($signer); - - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!preg_match('#^application/(x\-)?pkcs7-mime; smime-type=enveloped\-data;#', $headers['content-type'])) { - $this->fail('Content-type does not match.'); - - return false; - } - - $expectedBody = '(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})'; - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStream->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt.crt', ['file://'.$this->samplesDir.'smime/encrypt.key', 'swift'])) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $decryptedMessage = $decryptedMessageStream->getContent(); - $decryptedHeaders = self::getHeadersOfMessage($decryptedMessage); - $this->assertEquals('message/rfc822; charset=utf-8', $decryptedHeaders['content-type']); - $this->assertEquals('7bit', $decryptedHeaders['content-transfer-encoding']); - - $decryptedMessageBody = self::getBodyOfMessage($decryptedMessage); - $this->assertEquals($originalMessage, $decryptedMessageBody); - unset($decryptedMessageStream, $messageStream); - } - - public function testEncryptedMessageWithMultipleCerts() - { - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself'); - - $originalMessage = $this->cleanMessage($message->toString()); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setEncryptCertificate([$this->samplesDir.'smime/encrypt.crt', $this->samplesDir.'smime/encrypt2.crt']); - $message->attachSigner($signer); - - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!preg_match('#^application/(x\-)?pkcs7-mime; smime-type=enveloped\-data;#', $headers['content-type'])) { - $this->fail('Content-type does not match.'); - - return false; - } - - $expectedBody = '(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})'; - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStream->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt.crt', ['file://'.$this->samplesDir.'smime/encrypt.key', 'swift'])) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $this->assertEquals($originalMessage, $decryptedMessageStream->getContent()); - unset($decryptedMessageStream); - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStream->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt2.crt', ['file://'.$this->samplesDir.'smime/encrypt2.key', 'swift'])) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $this->assertEquals($originalMessage, $decryptedMessageStream->getContent()); - unset($decryptedMessageStream, $messageStream); - } - - public function testSignThenEncryptedMessage() - { - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself'); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key'); - $signer->setEncryptCertificate($this->samplesDir.'smime/encrypt.crt'); - $message->attachSigner($signer); - - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!preg_match('#^application/(x\-)?pkcs7-mime; smime-type=enveloped\-data;#', $headers['content-type'])) { - $this->fail('Content-type does not match.'); - - return false; - } - - $expectedBody = '(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2})'; - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStream->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt.crt', ['file://'.$this->samplesDir.'smime/encrypt.key', 'swift'])) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $entityString = $decryptedMessageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<assertValidVerify($expectedBody, $decryptedMessageStream)) { - return false; - } - - unset($decryptedMessageStream, $messageStream); - } - - public function testEncryptThenSignMessage() - { - $message = (new Swift_Message('Wonderful Subject')) - ->setFrom(['john@doe.com' => 'John Doe']) - ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) - ->setBody('Here is the message itself'); - - $originalMessage = $message->toString(); - - $signer = new Swift_Signers_SMimeSigner(); - $signer->setSignCertificate($this->samplesDir.'smime/sign.crt', $this->samplesDir.'smime/sign.key'); - $signer->setEncryptCertificate($this->samplesDir.'smime/encrypt.crt'); - $signer->setSignThenEncrypt(false); - $message->attachSigner($signer); - - $messageStream = $this->newFilteredStream(); - $message->toByteStream($messageStream); - $messageStream->commit(); - - $entityString = $messageStream->getContent(); - $headers = self::getHeadersOfMessage($entityString); - - if (!($boundary = $this->getBoundary($headers['content-type']))) { - return false; - } - - $expectedBody = <<Content-Type: application/(x\-)?pkcs7-mime; smime-type=enveloped-data; - name="smime\.p7m"; charset=utf-8 -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="smime\.p7m" - -(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2}) - - -)--$boundary -Content-Type: application/(x\-)?pkcs7-signature; name="smime\.p7s" -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="smime\.p7s" - -(?:^[a-zA-Z0-9\/\\r\\n+]*={0,2}) - ---$boundary-- -OEL; - - if (!$this->assertValidVerify($expectedBody, $messageStream)) { - return false; - } - - $expectedBody = str_replace("\n", "\r\n", $expectedBody); - if (!preg_match('%'.$expectedBody.'*%m', $entityString, $entities)) { - $this->fail('Failed regex match.'); - - return false; - } - - $messageStreamClean = new Swift_ByteStream_TemporaryFileByteStream(); - $messageStreamClean->write($entities['encrypted_message']); - - $decryptedMessageStream = new Swift_ByteStream_TemporaryFileByteStream(); - - if (!openssl_pkcs7_decrypt($messageStreamClean->getPath(), $decryptedMessageStream->getPath(), 'file://'.$this->samplesDir.'smime/encrypt.crt', ['file://'.$this->samplesDir.'smime/encrypt.key', 'swift'])) { - $this->fail(sprintf('Decrypt of the message failed. Internal error "%s".', openssl_error_string())); - } - - $this->assertEquals($originalMessage, $decryptedMessageStream->getContent()); - unset($messageStreamClean, $messageStream, $decryptedMessageStream); - } - - protected function assertValidVerify($expected, Swift_ByteStream_TemporaryFileByteStream $messageStream) - { - $actual = $messageStream->getContent(); - - // File is UNIX encoded so convert them to correct line ending - $expected = str_replace("\n", "\r\n", $expected); - - $actual = self::getBodyOfMessage($actual); - if (!$this->assertRegExp('%^'.$expected.'$\s*%m', $actual)) { - return false; - } - - $opensslOutput = new Swift_ByteStream_TemporaryFileByteStream(); - $verify = openssl_pkcs7_verify($messageStream->getPath(), null, $opensslOutput->getPath(), [$this->samplesDir.'smime/ca.crt']); - - if (false === $verify) { - $this->fail('Verification of the message failed.'); - - return false; - } elseif (-1 === $verify) { - $this->fail(sprintf('Verification of the message failed. Internal error "%s".', openssl_error_string())); - - return false; - } - - return true; - } - - protected function getBoundary($contentType) - { - if (!preg_match('/boundary=("[^"]+"|(?:[^\s]+|$))/is', $contentType, $contentTypeData)) { - $this->fail('Failed to find Boundary parameter'); - - return false; - } - - return trim($contentTypeData[1], '"'); - } - - protected function newFilteredStream() - { - $messageStream = new Swift_ByteStream_TemporaryFileByteStream(); - $messageStream->addFilter($this->replacementFactory->createFilter("\r\n", "\n"), 'CRLF to LF'); - $messageStream->addFilter($this->replacementFactory->createFilter("\n", "\r\n"), 'LF to CRLF'); - - return $messageStream; - } - - protected static function getBodyOfMessage($message) - { - return trim(substr($message, strpos($message, "\r\n\r\n"))); - } - - /** - * Strips of the sender headers and Mime-Version. - */ - protected function cleanMessage($content) - { - $newContent = ''; - - $headers = self::getHeadersOfMessage($content); - foreach ($headers as $headerName => $value) { - if (!in_array($headerName, ['content-type', 'content-transfer-encoding', 'content-disposition'])) { - continue; - } - - $headerName = explode('-', $headerName); - $headerName = array_map('ucfirst', $headerName); - $headerName = implode('-', $headerName); - - if (strlen($value) > 62) { - $value = wordwrap($value, 62, "\n "); - } - - $newContent .= "$headerName: $value\r\n"; - } - - return $newContent."\r\n".self::getBodyOfMessage($content); - } - - /** - * Returns the headers of the message. - * - * Header-names are lowercase. - * - * @param string $message - * - * @return array - */ - protected static function getHeadersOfMessage($message) - { - $headersPosEnd = strpos($message, "\r\n\r\n"); - $headerData = trim(substr($message, 0, $headersPosEnd)); - $headerLines = explode("\r\n", $headerData); - $headers = []; - - if (false === $headerLines) { - return $headers; - } - - // Transform header lines into an associative array - $currentHeaderName = ''; - foreach ($headerLines as $headerLine) { - // Handle headers that span multiple lines - if (false === strpos($headerLine, ':')) { - $headers[$currentHeaderName] .= ' '.trim($headerLine); - continue; - } - - $header = explode(':', $headerLine, 2); - $currentHeaderName = strtolower($header[0]); - $headers[$currentHeaderName] = trim($header[1]); - } - - return $headers; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php deleted file mode 100644 index 3c812242a..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/ByteArrayReplacementFilterTest.php +++ /dev/null @@ -1,129 +0,0 @@ -createFilter([0x61, 0x62], [0x63, 0x64]); - $this->assertEquals( - [0x59, 0x60, 0x63, 0x64, 0x65], - $filter->filter([0x59, 0x60, 0x61, 0x62, 0x65]) - ); - } - - public function testShouldBufferReturnsTrueIfPartialMatchAtEndOfBuffer() - { - $filter = $this->createFilter([0x61, 0x62], [0x63, 0x64]); - $this->assertTrue($filter->shouldBuffer([0x59, 0x60, 0x61]), - '%s: Filter should buffer since 0x61 0x62 is the needle and the ending '. - '0x61 could be from 0x61 0x62' - ); - } - - public function testFilterCanMakeMultipleReplacements() - { - $filter = $this->createFilter([[0x61], [0x62]], [0x63]); - $this->assertEquals( - [0x60, 0x63, 0x60, 0x63, 0x60], - $filter->filter([0x60, 0x61, 0x60, 0x62, 0x60]) - ); - } - - public function testMultipleReplacementsCanBeDifferent() - { - $filter = $this->createFilter([[0x61], [0x62]], [[0x63], [0x64]]); - $this->assertEquals( - [0x60, 0x63, 0x60, 0x64, 0x60], - $filter->filter([0x60, 0x61, 0x60, 0x62, 0x60]) - ); - } - - public function testShouldBufferReturnsFalseIfPartialMatchNotAtEndOfString() - { - $filter = $this->createFilter([0x0D, 0x0A], [0x0A]); - $this->assertFalse($filter->shouldBuffer([0x61, 0x62, 0x0D, 0x0A, 0x63]), - '%s: Filter should not buffer since x0Dx0A is the needle and is not at EOF' - ); - } - - public function testShouldBufferReturnsTrueIfAnyOfMultipleMatchesAtEndOfString() - { - $filter = $this->createFilter([[0x61, 0x62], [0x63]], [0x64]); - $this->assertTrue($filter->shouldBuffer([0x59, 0x60, 0x61]), - '%s: Filter should buffer since 0x61 0x62 is a needle and the ending '. - '0x61 could be from 0x61 0x62' - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsLF() - { - $filter = $this->createFilter( - [[0x0D, 0x0A], [0x0D], [0x0A]], - [[0x0A], [0x0A], [0x0D, 0x0A]] - ); - - $this->assertEquals( - [0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63], - $filter->filter([0x60, 0x0A, 0x61, 0x0A, 0x62, 0x0A, 0x63]) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsCR() - { - $filter = $this->createFilter( - [[0x0D, 0x0A], [0x0D], [0x0A]], - [[0x0A], [0x0A], [0x0D, 0x0A]] - ); - - $this->assertEquals( - [0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63], - $filter->filter([0x60, 0x0D, 0x61, 0x0D, 0x62, 0x0D, 0x63]) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsCRLF() - { - $filter = $this->createFilter( - [[0x0D, 0x0A], [0x0D], [0x0A]], - [[0x0A], [0x0A], [0x0D, 0x0A]] - ); - - $this->assertEquals( - [0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63], - $filter->filter([0x60, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x63]) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputIsLFCR() - { - $filter = $this->createFilter( - [[0x0D, 0x0A], [0x0D], [0x0A]], - [[0x0A], [0x0A], [0x0D, 0x0A]] - ); - - $this->assertEquals( - [0x60, 0x0D, 0x0A, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x0D, 0x0A, 0x63], - $filter->filter([0x60, 0x0A, 0x0D, 0x61, 0x0A, 0x0D, 0x62, 0x0A, 0x0D, 0x63]) - ); - } - - public function testConvertingAllLineEndingsToCRLFWhenInputContainsLFLF() - { - //Lighthouse Bug #23 - - $filter = $this->createFilter( - [[0x0D, 0x0A], [0x0D], [0x0A]], - [[0x0A], [0x0A], [0x0D, 0x0A]] - ); - - $this->assertEquals( - [0x60, 0x0D, 0x0A, 0x0D, 0x0A, 0x61, 0x0D, 0x0A, 0x0D, 0x0A, 0x62, 0x0D, 0x0A, 0x0D, 0x0A, 0x63], - $filter->filter([0x60, 0x0A, 0x0A, 0x61, 0x0A, 0x0A, 0x62, 0x0A, 0x0A, 0x63]) - ); - } - - private function createFilter($search, $replace) - { - return new Swift_StreamFilters_ByteArrayReplacementFilter($search, $replace); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php deleted file mode 100644 index 514829f62..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterFactoryTest.php +++ /dev/null @@ -1,36 +0,0 @@ -createFactory(); - $this->assertInstanceOf( - 'Swift_StreamFilters_StringReplacementFilter', - $factory->createFilter('a', 'b') - ); - } - - public function testSameInstancesAreCached() - { - $factory = $this->createFactory(); - $filter1 = $factory->createFilter('a', 'b'); - $filter2 = $factory->createFilter('a', 'b'); - $this->assertSame($filter1, $filter2, '%s: Instances should be cached'); - } - - public function testDifferingInstancesAreNotCached() - { - $factory = $this->createFactory(); - $filter1 = $factory->createFilter('a', 'b'); - $filter2 = $factory->createFilter('a', 'c'); - $this->assertNotEquals($filter1, $filter2, - '%s: Differing instances should not be cached' - ); - } - - private function createFactory() - { - return new Swift_StreamFilters_StringReplacementFilterFactory(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php deleted file mode 100644 index 1a5f4dca7..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/StreamFilters/StringReplacementFilterTest.php +++ /dev/null @@ -1,59 +0,0 @@ -createFilter('foo', 'bar'); - $this->assertEquals('XbarYbarZ', $filter->filter('XfooYfooZ')); - } - - public function testShouldBufferReturnsTrueIfPartialMatchAtEndOfBuffer() - { - $filter = $this->createFilter('foo', 'bar'); - $this->assertTrue($filter->shouldBuffer('XfooYf'), - '%s: Filter should buffer since "foo" is the needle and the ending '. - '"f" could be from "foo"' - ); - } - - public function testFilterCanMakeMultipleReplacements() - { - $filter = $this->createFilter(['a', 'b'], 'foo'); - $this->assertEquals('XfooYfooZ', $filter->filter('XaYbZ')); - } - - public function testMultipleReplacementsCanBeDifferent() - { - $filter = $this->createFilter(['a', 'b'], ['foo', 'zip']); - $this->assertEquals('XfooYzipZ', $filter->filter('XaYbZ')); - } - - public function testShouldBufferReturnsFalseIfPartialMatchNotAtEndOfString() - { - $filter = $this->createFilter("\r\n", "\n"); - $this->assertFalse($filter->shouldBuffer("foo\r\nbar"), - '%s: Filter should not buffer since x0Dx0A is the needle and is not at EOF' - ); - } - - public function testShouldBufferReturnsTrueIfAnyOfMultipleMatchesAtEndOfString() - { - $filter = $this->createFilter(['foo', 'zip'], 'bar'); - $this->assertTrue($filter->shouldBuffer('XfooYzi'), - '%s: Filter should buffer since "zip" is a needle and the ending '. - '"zi" could be from "zip"' - ); - } - - public function testShouldBufferReturnsFalseOnEmptyBuffer() - { - $filter = $this->createFilter("\r\n", "\n"); - $this->assertFalse($filter->shouldBuffer('')); - } - - private function createFilter($search, $replace) - { - return new Swift_StreamFilters_StringReplacementFilter($search, $replace); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php deleted file mode 100644 index 896171dcd..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpEventSupportTest.php +++ /dev/null @@ -1,558 +0,0 @@ -getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $listener = $this->getMockery('Swift_Events_EventListener'); - $smtp = $this->getTransport($buf, $dispatcher); - $dispatcher->shouldReceive('bindEventListener') - ->once() - ->with($listener); - - $smtp->registerPlugin($listener); - } - - public function testSendingDispatchesBeforeSendEvent() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $message = $this->createMessage(); - $smtp = $this->getTransport($buf, $dispatcher); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['chris@swiftmailer.org' => null]); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['mark@swiftmailer.org' => 'Mark']); - $dispatcher->shouldReceive('createSendEvent') - ->once() - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeSendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(1, $smtp->send($message)); - } - - public function testSendingDispatchesSendEvent() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $message = $this->createMessage(); - $smtp = $this->getTransport($buf, $dispatcher); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['chris@swiftmailer.org' => null]); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['mark@swiftmailer.org' => 'Mark']); - $dispatcher->shouldReceive('createSendEvent') - ->once() - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(1, $smtp->send($message)); - } - - public function testSendEventCapturesFailures() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->getTransport($buf, $dispatcher); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['chris@swiftmailer.org' => null]); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['mark@swiftmailer.org' => 'Mark']); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("500 Not now\r\n"); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - $evt->shouldReceive('setFailedRecipients') - ->once() - ->with(['mark@swiftmailer.org']); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(0, $smtp->send($message)); - } - - public function testSendEventHasResultFailedIfAllFailures() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->getTransport($buf, $dispatcher); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['chris@swiftmailer.org' => null]); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['mark@swiftmailer.org' => 'Mark']); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("500 Not now\r\n"); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - $evt->shouldReceive('setResult') - ->once() - ->with(Swift_Events_SendEvent::RESULT_FAILED); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(0, $smtp->send($message)); - } - - public function testSendEventHasResultTentativeIfSomeFailures() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->getTransport($buf, $dispatcher); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['chris@swiftmailer.org' => null]); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn([ - 'mark@swiftmailer.org' => 'Mark', - 'chris@site.tld' => 'Chris', - ]); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("500 Not now\r\n"); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - $evt->shouldReceive('setResult') - ->once() - ->with(Swift_Events_SendEvent::RESULT_TENTATIVE); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(1, $smtp->send($message)); - } - - public function testSendEventHasResultSuccessIfNoFailures() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->getTransport($buf, $dispatcher); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['chris@swiftmailer.org' => null]); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn([ - 'mark@swiftmailer.org' => 'Mark', - 'chris@site.tld' => 'Chris', - ]); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'sendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturn(false); - $evt->shouldReceive('setResult') - ->once() - ->with(Swift_Events_SendEvent::RESULT_SUCCESS); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(2, $smtp->send($message)); - } - - public function testCancellingEventBubbleBeforeSendStopsEvent() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_SendEvent')->shouldIgnoreMissing(); - $smtp = $this->getTransport($buf, $dispatcher); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['chris@swiftmailer.org' => null]); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['mark@swiftmailer.org' => 'Mark']); - $dispatcher->shouldReceive('createSendEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeSendPerformed'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(true); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(0, $smtp->send($message)); - } - - public function testStartingTransportDispatchesTransportChangeEvent() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent'); - $smtp = $this->getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'transportStarted'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(false); - - $this->finishBuffer($buf); - $smtp->start(); - } - - public function testStartingTransportDispatchesBeforeTransportChangeEvent() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent'); - $smtp = $this->getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeTransportStarted'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(false); - - $this->finishBuffer($buf); - $smtp->start(); - } - - public function testCancellingBubbleBeforeTransportStartStopsEvent() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent'); - $smtp = $this->getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeTransportStarted'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(true); - - $this->finishBuffer($buf); - $smtp->start(); - - $this->assertFalse($smtp->isStarted(), - '%s: Transport should not be started since event bubble was cancelled' - ); - } - - public function testStoppingTransportDispatchesTransportChangeEvent() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent')->shouldIgnoreMissing(); - $smtp = $this->getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'transportStopped'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->stop(); - } - - public function testStoppingTransportDispatchesBeforeTransportChangeEvent() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent')->shouldIgnoreMissing(); - $smtp = $this->getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeTransportStopped'); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->stop(); - } - - public function testCancellingBubbleBeforeTransportStoppedStopsEvent() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportChangeEvent'); - $smtp = $this->getTransport($buf, $dispatcher); - - $hasRun = false; - $dispatcher->shouldReceive('createTransportChangeEvent') - ->atLeast()->once() - ->with($smtp) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'beforeTransportStopped') - ->andReturnUsing(function () use (&$hasRun) { - $hasRun = true; - }); - $dispatcher->shouldReceive('dispatchEvent') - ->zeroOrMoreTimes(); - $evt->shouldReceive('bubbleCancelled') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$hasRun) { - return $hasRun; - }); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->stop(); - - $this->assertTrue($smtp->isStarted(), - '%s: Transport should not be stopped since event bubble was cancelled' - ); - } - - public function testResponseEventsAreGenerated() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_ResponseEvent'); - $smtp = $this->getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createResponseEvent') - ->atLeast()->once() - ->with($smtp, \Mockery::any(), \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->atLeast()->once() - ->with($evt, 'responseReceived'); - - $this->finishBuffer($buf); - $smtp->start(); - } - - public function testCommandEventsAreGenerated() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_CommandEvent'); - $smtp = $this->getTransport($buf, $dispatcher); - - $dispatcher->shouldReceive('createCommandEvent') - ->once() - ->with($smtp, \Mockery::any(), \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'commandSent'); - - $this->finishBuffer($buf); - $smtp->start(); - } - - public function testExceptionsCauseExceptionEvents() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportExceptionEvent'); - $smtp = $this->getTransport($buf, $dispatcher); - - $buf->shouldReceive('readLine') - ->atLeast()->once() - ->andReturn("503 I'm sleepy, go away!\r\n"); - $dispatcher->shouldReceive('createTransportExceptionEvent') - ->zeroOrMoreTimes() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->once() - ->with($evt, 'exceptionThrown'); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(false); - - try { - $smtp->start(); - $this->fail('TransportException should be thrown on invalid response'); - } catch (Swift_TransportException $e) { - } - } - - public function testExceptionBubblesCanBeCancelled() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(false); - $evt = $this->getMockery('Swift_Events_TransportExceptionEvent'); - $smtp = $this->getTransport($buf, $dispatcher); - - $buf->shouldReceive('readLine') - ->atLeast()->once() - ->andReturn("503 I'm sleepy, go away!\r\n"); - $dispatcher->shouldReceive('createTransportExceptionEvent') - ->twice() - ->with($smtp, \Mockery::any()) - ->andReturn($evt); - $dispatcher->shouldReceive('dispatchEvent') - ->twice() - ->with($evt, 'exceptionThrown'); - $evt->shouldReceive('bubbleCancelled') - ->atLeast()->once() - ->andReturn(true); - - $this->finishBuffer($buf); - $smtp->start(); - } - - protected function createEventDispatcher($stub = true) - { - return $this->getMockery('Swift_Events_EventDispatcher')->shouldIgnoreMissing(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php deleted file mode 100644 index 4c837fad5..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/AbstractSmtpTest.php +++ /dev/null @@ -1,1400 +0,0 @@ -getBuffer(); - $smtp = $this->getTransport($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - - $this->finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->assertTrue($smtp->isStarted(), '%s: start() should have started connection'); - } catch (Exception $e) { - $this->fail('220 is a valid SMTP greeting and should be accepted'); - } - } - - public function testBadGreetingCausesException() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("554 I'm busy\r\n"); - $this->finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->fail('554 greeting indicates an error and should cause an exception'); - } catch (Swift_TransportException $e) { - $this->assertFalse($smtp->isStarted(), '%s: start() should have failed'); - } - } - - public function testStartSendsHeloToInitiate() - { - /* -- RFC 2821, 3.2. - - 3.2 Client Initiation - - Once the server has sent the welcoming message and the client has - received it, the client normally sends the EHLO command to the - server, indicating the client's identity. In addition to opening the - session, use of EHLO indicates that the client is able to process - service extensions and requests that the server provide a list of the - extensions it supports. Older SMTP systems which are unable to - support service extensions and contemporary clients which do not - require service extensions in the mail session being initiated, MAY - use HELO instead of EHLO. Servers MUST NOT return the extended - EHLO-style response to a HELO command. For a particular connection - attempt, if the server returns a "command not recognized" response to - EHLO, the client SHOULD be able to fall back and send HELO. - - In the EHLO command the host sending the command identifies itself; - the command may be interpreted as saying "Hello, I am " (and, - in the case of EHLO, "and I support service extension requests"). - - -- RFC 2281, 4.1.1.1. - - ehlo = "EHLO" SP Domain CRLF - helo = "HELO" SP Domain CRLF - - -- RFC 2821, 4.3.2. - - EHLO or HELO - S: 250 - E: 504, 550 - - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^HELO example.org\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 ServerName'."\r\n"); - - $this->finishBuffer($buf); - try { - $smtp->start(); - } catch (Exception $e) { - $this->fail('Starting SMTP should send HELO and accept 250 response'); - } - } - - public function testInvalidHeloResponseCausesException() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^HELO example.org\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('504 WTF'."\r\n"); - - $this->finishBuffer($buf); - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->fail('Non 250 HELO response should raise Exception'); - } catch (Swift_TransportException $e) { - $this->assertFalse($smtp->isStarted(), '%s: SMTP start() should have failed'); - } - } - - public function testDomainNameIsPlacedInHelo() - { - /* -- RFC 2821, 4.1.4. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("HELO mydomain.com\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 ServerName'."\r\n"); - - $this->finishBuffer($buf); - $smtp->setLocalDomain('mydomain.com'); - $smtp->start(); - } - - public function testSuccessfulMailCommand() - { - /* -- RFC 2821, 3.3. - - There are three steps to SMTP mail transactions. The transaction - starts with a MAIL command which gives the sender identification. - - ..... - - The first step in the procedure is the MAIL command. - - MAIL FROM: [SP ] - - -- RFC 2821, 4.1.1.2. - - Syntax: - - "MAIL FROM:" ("<>" / Reverse-Path) - [SP Mail-parameters] CRLF - -- RFC 2821, 4.1.2. - - Reverse-path = Path - Forward-path = Path - Path = "<" [ A-d-l ":" ] Mailbox ">" - A-d-l = At-domain *( "," A-d-l ) - ; Note that this form, the so-called "source route", - ; MUST BE accepted, SHOULD NOT be generated, and SHOULD be - ; ignored. - At-domain = "@" domain - - -- RFC 2821, 4.3.2. - - MAIL - S: 250 - E: 552, 451, 452, 550, 553, 503 - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - - $this->finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - } catch (Exception $e) { - $this->fail('MAIL FROM should accept a 250 response'); - } - } - - public function testInvalidResponseCodeFromMailCausesException() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('553 Bad'."\r\n"); - - $this->finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('MAIL FROM should accept a 250 response'); - } catch (Swift_TransportException $e) { - } - } - - public function testSenderIsPreferredOverFrom() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getSender') - ->once() - ->andReturn(['another@domain.com' => 'Someone']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testReturnPathIsPreferredOverSender() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getSender') - ->once() - ->andReturn(['another@domain.com' => 'Someone']); - $message->shouldReceive('getReturnPath') - ->once() - ->andReturn('more@domain.com'); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testSuccessfulRcptCommandWith250Response() - { - /* -- RFC 2821, 3.3. - - The second step in the procedure is the RCPT command. - - RCPT TO: [ SP ] - - The first or only argument to this command includes a forward-path - (normally a mailbox and domain, always surrounded by "<" and ">" - brackets) identifying one recipient. If accepted, the SMTP server - returns a 250 OK reply and stores the forward-path. If the recipient - is known not to be a deliverable address, the SMTP server returns a - 550 reply, typically with a string such as "no such user - " and the - mailbox name (other circumstances and reply codes are possible). - This step of the procedure can be repeated any number of times. - - -- RFC 2821, 4.1.1.3. - - This command is used to identify an individual recipient of the mail - data; multiple recipients are specified by multiple use of this - command. The argument field contains a forward-path and may contain - optional parameters. - - The forward-path normally consists of the required destination - mailbox. Sending systems SHOULD not generate the optional list of - hosts known as a source route. - - ....... - - "RCPT TO:" ("" / "" / Forward-Path) - [SP Rcpt-parameters] CRLF - - -- RFC 2821, 4.2.2. - - 250 Requested mail action okay, completed - 251 User not local; will forward to - (See section 3.4) - 252 Cannot VRFY user, but will accept message and attempt - delivery - - -- RFC 2821, 4.3.2. - - RCPT - S: 250, 251 (but see section 3.4 for discussion of 251 and 551) - E: 550, 551, 552, 553, 450, 451, 452, 503, 550 - */ - - //We'll treat 252 as accepted since it isn't really a failure - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - } catch (Exception $e) { - $this->fail('RCPT TO should accept a 250 response'); - } - } - - public function testUtf8AddressWithIdnEncoder() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@dömain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bär' => null]); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testUtf8AddressWithUtf8Encoder() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf, null, new Swift_AddressEncoder_Utf8AddressEncoder()); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['më@dömain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['föö@bär' => null]); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testNonEncodableSenderCausesException() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['më@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - - $this->finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('më@domain.com cannot be encoded (not observed)'); - } catch (Swift_AddressEncoderException $e) { - $this->assertEquals('më@domain.com', $e->getAddress()); - } - } - - public function testMailFromCommandIsOnlySentOncePerMessage() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->never() - ->with("MAIL FROM:\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testMultipleRecipientsSendsMultipleRcpt() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn([ - 'foo@bar' => null, - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - 'tëst@domain' => 'Test user', - ]); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testCcRecipientsSendsMultipleRcpt() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $message->shouldReceive('getCc') - ->once() - ->andReturn([ - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - ]); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testSendReturnsNumberOfSuccessfulRecipients() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $message->shouldReceive('getCc') - ->once() - ->andReturn([ - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - ]); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('501 Nobody here'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(2, $smtp->send($message), - '%s: 1 of 3 recipients failed so 2 should be returned' - ); - } - - public function testRsetIsSentIfNoSuccessfulRecipients() - { - /* --RFC 2821, 4.1.1.5. - - This command specifies that the current mail transaction will be - aborted. Any stored sender, recipients, and mail data MUST be - discarded, and all buffers and state tables cleared. The receiver - MUST send a "250 OK" reply to a RSET command with no arguments. A - reset command may be issued by the client at any time. - - -- RFC 2821, 4.3.2. - - RSET - S: 250 - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('503 Bad'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RSET\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(0, $smtp->send($message), - '%s: 1 of 1 recipients failed so 0 should be returned' - ); - } - - public function testSuccessfulDataCommand() - { - /* -- RFC 2821, 3.3. - - The third step in the procedure is the DATA command (or some - alternative specified in a service extension). - - DATA - - If accepted, the SMTP server returns a 354 Intermediate reply and - considers all succeeding lines up to but not including the end of - mail data indicator to be the message text. - - -- RFC 2821, 4.1.1.4. - - The receiver normally sends a 354 response to DATA, and then treats - the lines (strings ending in sequences, as described in - section 2.3.7) following the command as mail data from the sender. - This command causes the mail data to be appended to the mail data - buffer. The mail data may contain any of the 128 ASCII character - codes, although experience has indicated that use of control - characters other than SP, HT, CR, and LF may cause problems and - SHOULD be avoided when possible. - - -- RFC 2821, 4.3.2. - - DATA - I: 354 -> data -> S: 250 - E: 552, 554, 451, 452 - E: 451, 554, 503 - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('354 Go ahead'."\r\n"); - - $this->finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - } catch (Exception $e) { - $this->fail('354 is the expected response to DATA'); - } - } - - public function testBadDataResponseCausesException() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('451 Bad'."\r\n"); - - $this->finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('354 is the expected response to DATA (not observed)'); - } catch (Swift_TransportException $e) { - } - } - - public function testMessageIsStreamedToBufferForData() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('354 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("\r\n.\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testBadResponseAfterDataTransmissionCausesException() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->once() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->once() - ->andReturn(['foo@bar' => null]); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('354 OK'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("\r\n.\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('554 Error'."\r\n"); - - $this->finishBuffer($buf); - try { - $smtp->start(); - $smtp->send($message); - $this->fail('250 is the expected response after a DATA transmission (not observed)'); - } catch (Swift_TransportException $e) { - } - } - - public function testBccRecipientsAreRemovedFromHeaders() - { - /* -- RFC 2821, 7.2. - - Addresses that do not appear in the message headers may appear in the - RCPT commands to an SMTP server for a number of reasons. The two - most common involve the use of a mailing address as a "list exploder" - (a single address that resolves into multiple addresses) and the - appearance of "blind copies". Especially when more than one RCPT - command is present, and in order to avoid defeating some of the - purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy - the full set of RCPT command arguments into the headers, either as - part of trace headers or as informational or private-extension - headers. Since this rule is often violated in practice, and cannot - be enforced, sending SMTP systems that are aware of "bcc" use MAY - find it helpful to send each blind copy as a separate message - transaction containing only a single RCPT command. - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - $message->shouldReceive('getBcc') - ->zeroOrMoreTimes() - ->andReturn([ - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - ]); - $message->shouldReceive('setBcc') - ->once() - ->with([]); - $message->shouldReceive('setBcc') - ->zeroOrMoreTimes(); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testEachBccRecipientIsSentASeparateMessage() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - $message->shouldReceive('getBcc') - ->zeroOrMoreTimes() - ->andReturn([ - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - ]); - $message->shouldReceive('setBcc') - ->atLeast()->once() - ->with([]); - $message->shouldReceive('setBcc') - ->once() - ->with(['zip@button' => 'Zip Button']); - $message->shouldReceive('setBcc') - ->once() - ->with(['test@domain' => 'Test user']); - $message->shouldReceive('setBcc') - ->atLeast()->once() - ->with([ - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - ]); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(1); - $buf->shouldReceive('readLine')->once()->with(1)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(2); - $buf->shouldReceive('readLine')->once()->with(2)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(3); - $buf->shouldReceive('readLine')->once()->with(3)->andReturn("354 OK\r\n"); - $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(4); - $buf->shouldReceive('readLine')->once()->with(4)->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(5); - $buf->shouldReceive('readLine')->once()->with(5)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(6); - $buf->shouldReceive('readLine')->once()->with(6)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(7); - $buf->shouldReceive('readLine')->once()->with(7)->andReturn("354 OK\r\n"); - $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(8); - $buf->shouldReceive('readLine')->once()->with(8)->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(9); - $buf->shouldReceive('readLine')->once()->with(9)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(10); - $buf->shouldReceive('readLine')->once()->with(10)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(11); - $buf->shouldReceive('readLine')->once()->with(11)->andReturn("354 OK\r\n"); - $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(12); - $buf->shouldReceive('readLine')->once()->with(12)->andReturn("250 OK\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(3, $smtp->send($message)); - } - - public function testMessageStateIsRestoredOnFailure() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - $message->shouldReceive('getBcc') - ->zeroOrMoreTimes() - ->andReturn([ - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - ]); - $message->shouldReceive('setBcc') - ->once() - ->with([]); - $message->shouldReceive('setBcc') - ->once() - ->with([ - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - ]); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("DATA\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn("451 No\r\n"); - - $this->finishBuffer($buf); - - $smtp->start(); - try { - $smtp->send($message); - $this->fail('A bad response was given so exception is expected'); - } catch (Swift_TransportException $e) { - } - } - - public function testStopSendsQuitCommand() - { - /* -- RFC 2821, 4.1.1.10. - - This command specifies that the receiver MUST send an OK reply, and - then close the transmission channel. - - The receiver MUST NOT intentionally close the transmission channel - until it receives and replies to a QUIT command (even if there was an - error). The sender MUST NOT intentionally close the transmission - channel until it sends a QUIT command and SHOULD wait until it - receives the reply (even if there was an error response to a previous - command). If the connection is closed prematurely due to violations - of the above or system or network failure, the server MUST cancel any - pending transaction, but not undo any previously completed - transaction, and generally MUST act as if the command or transaction - in progress had received a temporary error (i.e., a 4yz response). - - The QUIT command may be issued at any time. - - Syntax: - "QUIT" CRLF - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('write') - ->once() - ->with("QUIT\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("221 Bye\r\n"); - $buf->shouldReceive('terminate') - ->once(); - - $this->finishBuffer($buf); - - $this->assertFalse($smtp->isStarted()); - $smtp->start(); - $this->assertTrue($smtp->isStarted()); - $smtp->stop(); - $this->assertFalse($smtp->isStarted()); - } - - public function testBufferCanBeFetched() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $ref = $smtp->getBuffer(); - $this->assertEquals($buf, $ref); - } - - public function testBufferCanBeWrittenToUsingExecuteCommand() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("FOO\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with(1) - ->andReturn("250 OK\r\n"); - - $res = $smtp->executeCommand("FOO\r\n"); - $this->assertEquals("250 OK\r\n", $res); - } - - public function testResponseCodesAreValidated() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("FOO\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with(1) - ->andReturn("551 Not ok\r\n"); - - try { - $smtp->executeCommand("FOO\r\n", [250, 251]); - $this->fail('A 250 or 251 response was needed but 551 was returned.'); - } catch (Swift_TransportException $e) { - } - } - - public function testFailedRecipientsCanBeCollectedByReference() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - $message->shouldReceive('getBcc') - ->zeroOrMoreTimes() - ->andReturn([ - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - ]); - $message->shouldReceive('setBcc') - ->atLeast()->once() - ->with([]); - $message->shouldReceive('setBcc') - ->once() - ->with(['zip@button' => 'Zip Button']); - $message->shouldReceive('setBcc') - ->once() - ->with(['test@domain' => 'Test user']); - $message->shouldReceive('setBcc') - ->atLeast()->once() - ->with([ - 'zip@button' => 'Zip Button', - 'test@domain' => 'Test user', - ]); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(1); - $buf->shouldReceive('readLine')->once()->with(1)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(2); - $buf->shouldReceive('readLine')->once()->with(2)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("DATA\r\n")->andReturn(3); - $buf->shouldReceive('readLine')->once()->with(3)->andReturn("354 OK\r\n"); - $buf->shouldReceive('write')->once()->with("\r\n.\r\n")->andReturn(4); - $buf->shouldReceive('readLine')->once()->with(4)->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(5); - $buf->shouldReceive('readLine')->once()->with(5)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(6); - $buf->shouldReceive('readLine')->once()->with(6)->andReturn("500 Bad\r\n"); - $buf->shouldReceive('write')->once()->with("RSET\r\n")->andReturn(7); - $buf->shouldReceive('readLine')->once()->with(7)->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write')->once()->with("MAIL FROM:\r\n")->andReturn(9); - $buf->shouldReceive('readLine')->once()->with(9)->andReturn("250 OK\r\n"); - $buf->shouldReceive('write')->once()->with("RCPT TO:\r\n")->andReturn(10); - $buf->shouldReceive('readLine')->once()->with(10)->andReturn("500 Bad\r\n"); - $buf->shouldReceive('write')->once()->with("RSET\r\n")->andReturn(11); - $buf->shouldReceive('readLine')->once()->with(11)->andReturn("250 OK\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertEquals(1, $smtp->send($message, $failures)); - $this->assertEquals(['zip@button', 'test@domain'], $failures, - '%s: Failures should be caught in an array' - ); - } - - public function testSendingRegeneratesMessageId() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $message = $this->createMessage(); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - $message->shouldReceive('generateId') - ->once(); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - } - - public function testPing() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^NOOP\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 OK'."\r\n"); - - $this->finishBuffer($buf); - $this->assertTrue($smtp->ping()); - } - - public function testPingOnDeadConnection() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^NOOP\r\n$~D') - ->andThrow('Swift_TransportException'); - - $this->finishBuffer($buf); - $smtp->start(); - $this->assertTrue($smtp->isStarted()); - $this->assertFalse($smtp->ping()); - $this->assertFalse($smtp->isStarted()); - } - - public function testSetLocalDomain() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - - $smtp->setLocalDomain('example.com'); - $this->assertEquals('example.com', $smtp->getLocalDomain()); - - $smtp->setLocalDomain('192.168.0.1'); - $this->assertEquals('[192.168.0.1]', $smtp->getLocalDomain()); - - $smtp->setLocalDomain('[192.168.0.1]'); - $this->assertEquals('[192.168.0.1]', $smtp->getLocalDomain()); - - $smtp->setLocalDomain('fd00::'); - $this->assertEquals('[IPv6:fd00::]', $smtp->getLocalDomain()); - - $smtp->setLocalDomain('[IPv6:fd00::]'); - $this->assertEquals('[IPv6:fd00::]', $smtp->getLocalDomain()); - } - - protected function getBuffer() - { - return $this->getMockery('Swift_Transport_IoBuffer')->shouldIgnoreMissing(); - } - - protected function createMessage() - { - return $this->getMockery('Swift_Mime_SimpleMessage')->shouldIgnoreMissing(); - } - - protected function finishBuffer($buf) - { - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with(0) - ->andReturn('220 server.com foo'."\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with('~^(EH|HE)LO .*?\r\n$~D') - ->andReturn($x = uniqid('', true)); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn('250 ServerName'."\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with('~^MAIL FROM:<.*?>\r\n$~D') - ->andReturn($x = uniqid('', true)); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with('~^RCPT TO:<.*?>\r\n$~D') - ->andReturn($x = uniqid('', true)); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("DATA\r\n") - ->andReturn($x = uniqid('', true)); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("354 OK\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("\r\n.\r\n") - ->andReturn($x = uniqid('', true)); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->with("RSET\r\n") - ->andReturn($x = uniqid('', true)); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->with($x) - ->andReturn("250 OK\r\n"); - - $buf->shouldReceive('write') - ->zeroOrMoreTimes() - ->andReturn(false); - $buf->shouldReceive('readLine') - ->zeroOrMoreTimes() - ->andReturn(false); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php deleted file mode 100644 index ba131e8ee..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/CramMd5AuthenticatorTest.php +++ /dev/null @@ -1,65 +0,0 @@ -agent = $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - public function testKeywordIsCramMd5() - { - /* -- RFC 2195, 2. - The authentication type associated with CRAM is "CRAM-MD5". - */ - - $cram = $this->getAuthenticator(); - $this->assertEquals('CRAM-MD5', $cram->getAuthKeyword()); - } - - public function testSuccessfulAuthentication() - { - $cram = $this->getAuthenticator(); - - $this->agent->shouldReceive('executeCommand') - ->once() - ->with("AUTH CRAM-MD5\r\n", [334]) - ->andReturn('334 '.base64_encode('')."\r\n"); - $this->agent->shouldReceive('executeCommand') - ->once() - ->with(\Mockery::any(), [235]); - - $this->assertTrue($cram->authenticate($this->agent, 'jack', 'pass'), - '%s: The buffer accepted all commands authentication should succeed' - ); - } - - /** - * @expectedException \Swift_TransportException - */ - public function testAuthenticationFailureSendRset() - { - $cram = $this->getAuthenticator(); - - $this->agent->shouldReceive('executeCommand') - ->once() - ->with("AUTH CRAM-MD5\r\n", [334]) - ->andReturn('334 '.base64_encode('')."\r\n"); - $this->agent->shouldReceive('executeCommand') - ->once() - ->with(\Mockery::any(), [235]) - ->andThrow(new Swift_TransportException('')); - $this->agent->shouldReceive('executeCommand') - ->once() - ->with("RSET\r\n", [250]); - - $cram->authenticate($this->agent, 'jack', 'pass'); - } - - private function getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_CramMd5Authenticator(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php deleted file mode 100644 index 499ceb772..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/LoginAuthenticatorTest.php +++ /dev/null @@ -1,65 +0,0 @@ -agent = $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - public function testKeywordIsLogin() - { - $login = $this->getAuthenticator(); - $this->assertEquals('LOGIN', $login->getAuthKeyword()); - } - - public function testSuccessfulAuthentication() - { - $login = $this->getAuthenticator(); - - $this->agent->shouldReceive('executeCommand') - ->once() - ->with("AUTH LOGIN\r\n", [334]); - $this->agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode('jack')."\r\n", [334]); - $this->agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode('pass')."\r\n", [235]); - - $this->assertTrue($login->authenticate($this->agent, 'jack', 'pass'), - '%s: The buffer accepted all commands authentication should succeed' - ); - } - - /** - * @expectedException \Swift_TransportException - */ - public function testAuthenticationFailureSendRset() - { - $login = $this->getAuthenticator(); - - $this->agent->shouldReceive('executeCommand') - ->once() - ->with("AUTH LOGIN\r\n", [334]); - $this->agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode('jack')."\r\n", [334]); - $this->agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode('pass')."\r\n", [235]) - ->andThrow(new Swift_TransportException('')); - $this->agent->shouldReceive('executeCommand') - ->once() - ->with("RSET\r\n", [250]); - - $login->authenticate($this->agent, 'jack', 'pass'); - } - - private function getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_LoginAuthenticator(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php deleted file mode 100644 index 98e2e25de..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/NTLMAuthenticatorTest.php +++ /dev/null @@ -1,204 +0,0 @@ -markTestSkipped('One of the required functions is not available.'); - } - } - - public function testKeywordIsNtlm() - { - $login = $this->getAuthenticator(); - $this->assertEquals('NTLM', $login->getAuthKeyword()); - } - - public function testMessage1Generator() - { - $login = $this->getAuthenticator(); - $message1 = $this->invokePrivateMethod('createMessage1', $login); - - $this->assertEquals($this->message1, bin2hex($message1), '%s: We send the smallest ntlm message which should never fail.'); - } - - public function testLMv1Generator() - { - $password = 'test1234'; - $challenge = 'b019d38bad875c9d'; - $lmv1 = '1879f60127f8a877022132ec221bcbf3ca016a9f76095606'; - - $login = $this->getAuthenticator(); - $lmv1Result = $this->invokePrivateMethod('createLMPassword', $login, [$password, hex2bin($challenge)]); - - $this->assertEquals($lmv1, bin2hex($lmv1Result), '%s: The keys should be the same cause we use the same values to generate them.'); - } - - public function testLMv2Generator() - { - $username = 'user'; - $password = 'SecREt01'; - $domain = 'DOMAIN'; - $challenge = '0123456789abcdef'; - $lmv2 = 'd6e6152ea25d03b7c6ba6629c2d6aaf0ffffff0011223344'; - - $login = $this->getAuthenticator(); - $lmv2Result = $this->invokePrivateMethod('createLMv2Password', $login, [$password, $username, $domain, hex2bin($challenge), hex2bin('ffffff0011223344')]); - - $this->assertEquals($lmv2, bin2hex($lmv2Result), '%s: The keys should be the same cause we use the same values to generate them.'); - } - - public function testMessage3v1Generator() - { - $username = 'test'; - $domain = 'TESTNT'; - $workstation = 'MEMBER'; - $lmResponse = '1879f60127f8a877022132ec221bcbf3ca016a9f76095606'; - $ntlmResponse = 'e6285df3287c5d194f84df1a94817c7282d09754b6f9e02a'; - $message3T = '4e544c4d5353500003000000180018006000000018001800780000000c000c0040000000080008004c0000000c000c0054000000000000009a0000000102000054004500530054004e00540074006500730074004d0045004d004200450052001879f60127f8a877022132ec221bcbf3ca016a9f76095606e6285df3287c5d194f84df1a94817c7282d09754b6f9e02a'; - - $login = $this->getAuthenticator(); - $message3 = $this->invokePrivateMethod('createMessage3', $login, [$domain, $username, $workstation, hex2bin($lmResponse), hex2bin($ntlmResponse)]); - - $this->assertEquals($message3T, bin2hex($message3), '%s: We send the same information as the example is created with so this should be the same'); - } - - public function testMessage3v2Generator() - { - $username = 'test'; - $domain = 'TESTNT'; - $workstation = 'MEMBER'; - $lmResponse = 'bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9'; - $ntlmResponse = 'caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000'; - - $login = $this->getAuthenticator(); - $message3 = $this->invokePrivateMethod('createMessage3', $login, [$domain, $username, $workstation, hex2bin($lmResponse), hex2bin($ntlmResponse)]); - - $this->assertEquals($this->message3, bin2hex($message3), '%s: We send the same information as the example is created with so this should be the same'); - } - - public function testGetDomainAndUsername() - { - $username = "DOMAIN\user"; - - $login = $this->getAuthenticator(); - list($domain, $user) = $this->invokePrivateMethod('getDomainAndUsername', $login, [$username]); - - $this->assertEquals('DOMAIN', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testGetDomainAndUsernameWithExtension() - { - $username = "domain.com\user"; - - $login = $this->getAuthenticator(); - list($domain, $user) = $this->invokePrivateMethod('getDomainAndUsername', $login, [$username]); - - $this->assertEquals('domain.com', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testGetDomainAndUsernameWithAtSymbol() - { - $username = 'user@DOMAIN'; - - $login = $this->getAuthenticator(); - list($domain, $user) = $this->invokePrivateMethod('getDomainAndUsername', $login, [$username]); - - $this->assertEquals('DOMAIN', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testGetDomainAndUsernameWithAtSymbolAndExtension() - { - $username = 'user@domain.com'; - - $login = $this->getAuthenticator(); - list($domain, $user) = $this->invokePrivateMethod('getDomainAndUsername', $login, [$username]); - - $this->assertEquals('domain.com', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testGetDomainAndUsernameWithoutDomain() - { - $username = 'user'; - - $login = $this->getAuthenticator(); - list($domain, $user) = $this->invokePrivateMethod('getDomainAndUsername', $login, [$username]); - - $this->assertEquals('', $domain, '%s: the fetched domain did not match'); - $this->assertEquals('user', $user, '%s: the fetched user did not match'); - } - - public function testSuccessfulAuthentication() - { - $domain = 'TESTNT'; - $username = 'test'; - $secret = 'test1234'; - - $ntlm = $this->getAuthenticator(); - $agent = $this->getAgent(); - $agent->shouldReceive('executeCommand') - ->once() - ->with('AUTH NTLM '.base64_encode( - $this->invokePrivateMethod('createMessage1', $ntlm) - )."\r\n", [334]) - ->andReturn('334 '.base64_encode(hex2bin('4e544c4d53535000020000000c000c003000000035828980514246973ea892c10000000000000000460046003c00000054004500530054004e00540002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d0000000000'))); - $agent->shouldReceive('executeCommand') - ->once() - ->with(base64_encode( - $this->invokePrivateMethod('createMessage3', $ntlm, [$domain, $username, hex2bin('4d0045004d00420045005200'), hex2bin('bf2e015119f6bdb3f6fdb768aa12d478f5ce3d2401c8f6e9'), hex2bin('caa4da8f25d5e840974ed8976d3ada46010100000000000030fa7e3c677bc301f5ce3d2401c8f6e90000000002000c0054004500530054004e00540001000c004d0045004d0042004500520003001e006d0065006d006200650072002e0074006500730074002e0063006f006d000000000000000000')] - ))."\r\n", [235]); - - $this->assertTrue($ntlm->authenticate($agent, $username.'@'.$domain, $secret, hex2bin('30fa7e3c677bc301'), hex2bin('f5ce3d2401c8f6e9')), '%s: The buffer accepted all commands authentication should succeed'); - } - - /** - * @expectedException \Swift_TransportException - */ - public function testAuthenticationFailureSendRset() - { - $domain = 'TESTNT'; - $username = 'test'; - $secret = 'test1234'; - - $ntlm = $this->getAuthenticator(); - $agent = $this->getAgent(); - $agent->shouldReceive('executeCommand') - ->once() - ->with('AUTH NTLM '.base64_encode( - $this->invokePrivateMethod('createMessage1', $ntlm) - )."\r\n", [334]) - ->andThrow(new Swift_TransportException('')); - $agent->shouldReceive('executeCommand') - ->once() - ->with("RSET\r\n", [250]); - - $ntlm->authenticate($agent, $username.'@'.$domain, $secret, hex2bin('30fa7e3c677bc301'), hex2bin('f5ce3d2401c8f6e9')); - } - - private function getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_NTLMAuthenticator(); - } - - private function getAgent() - { - return $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - private function invokePrivateMethod($method, $instance, array $args = []) - { - $methodC = new ReflectionMethod($instance, trim($method)); - $methodC->setAccessible(true); - - return $methodC->invokeArgs($instance, $args); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php deleted file mode 100644 index 1bb2c992b..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/Auth/PlainAuthenticatorTest.php +++ /dev/null @@ -1,68 +0,0 @@ -agent = $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - public function testKeywordIsPlain() - { - /* -- RFC 4616, 1. - The name associated with this mechanism is "PLAIN". - */ - - $login = $this->getAuthenticator(); - $this->assertEquals('PLAIN', $login->getAuthKeyword()); - } - - public function testSuccessfulAuthentication() - { - /* -- RFC 4616, 2. - The client presents the authorization identity (identity to act as), - followed by a NUL (U+0000) character, followed by the authentication - identity (identity whose password will be used), followed by a NUL - (U+0000) character, followed by the clear-text password. - */ - - $plain = $this->getAuthenticator(); - - $this->agent->shouldReceive('executeCommand') - ->once() - ->with('AUTH PLAIN '.base64_encode( - 'jack'.chr(0).'jack'.chr(0).'pass' - )."\r\n", [235]); - - $this->assertTrue($plain->authenticate($this->agent, 'jack', 'pass'), - '%s: The buffer accepted all commands authentication should succeed' - ); - } - - /** - * @expectedException \Swift_TransportException - */ - public function testAuthenticationFailureSendRset() - { - $plain = $this->getAuthenticator(); - - $this->agent->shouldReceive('executeCommand') - ->once() - ->with('AUTH PLAIN '.base64_encode( - 'jack'.chr(0).'jack'.chr(0).'pass' - )."\r\n", [235]) - ->andThrow(new Swift_TransportException('')); - $this->agent->shouldReceive('executeCommand') - ->once() - ->with("RSET\r\n", [250]); - - $plain->authenticate($this->agent, 'jack', 'pass'); - } - - private function getAuthenticator() - { - return new Swift_Transport_Esmtp_Auth_PlainAuthenticator(); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php deleted file mode 100644 index 36a4cf818..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/Esmtp/AuthHandlerTest.php +++ /dev/null @@ -1,165 +0,0 @@ -agent = $this->getMockery('Swift_Transport_SmtpAgent')->shouldIgnoreMissing(); - } - - public function testKeywordIsAuth() - { - $auth = $this->createHandler([]); - $this->assertEquals('AUTH', $auth->getHandledKeyword()); - } - - public function testUsernameCanBeSetAndFetched() - { - $auth = $this->createHandler([]); - $auth->setUsername('jack'); - $this->assertEquals('jack', $auth->getUsername()); - } - - public function testPasswordCanBeSetAndFetched() - { - $auth = $this->createHandler([]); - $auth->setPassword('pass'); - $this->assertEquals('pass', $auth->getPassword()); - } - - public function testAuthModeCanBeSetAndFetched() - { - $auth = $this->createHandler([]); - $auth->setAuthMode('PLAIN'); - $this->assertEquals('PLAIN', $auth->getAuthMode()); - } - - public function testMixinMethods() - { - $auth = $this->createHandler([]); - $mixins = $auth->exposeMixinMethods(); - $this->assertTrue(in_array('getUsername', $mixins), - '%s: getUsername() should be accessible via mixin' - ); - $this->assertTrue(in_array('setUsername', $mixins), - '%s: setUsername() should be accessible via mixin' - ); - $this->assertTrue(in_array('getPassword', $mixins), - '%s: getPassword() should be accessible via mixin' - ); - $this->assertTrue(in_array('setPassword', $mixins), - '%s: setPassword() should be accessible via mixin' - ); - $this->assertTrue(in_array('setAuthMode', $mixins), - '%s: setAuthMode() should be accessible via mixin' - ); - $this->assertTrue(in_array('getAuthMode', $mixins), - '%s: getAuthMode() should be accessible via mixin' - ); - } - - public function testAuthenticatorsAreCalledAccordingToParamsAfterEhlo() - { - $a1 = $this->createMockAuthenticator('PLAIN'); - $a2 = $this->createMockAuthenticator('LOGIN'); - - $a1->shouldReceive('authenticate') - ->never() - ->with($this->agent, 'jack', 'pass'); - $a2->shouldReceive('authenticate') - ->once() - ->with($this->agent, 'jack', 'pass') - ->andReturn(true); - - $auth = $this->createHandler([$a1, $a2]); - $auth->setUsername('jack'); - $auth->setPassword('pass'); - - $auth->setKeywordParams(['CRAM-MD5', 'LOGIN']); - $auth->afterEhlo($this->agent); - } - - public function testAuthenticatorsAreNotUsedIfNoUsernameSet() - { - $a1 = $this->createMockAuthenticator('PLAIN'); - $a2 = $this->createMockAuthenticator('LOGIN'); - - $a1->shouldReceive('authenticate') - ->never() - ->with($this->agent, 'jack', 'pass'); - $a2->shouldReceive('authenticate') - ->never() - ->with($this->agent, 'jack', 'pass') - ->andReturn(true); - - $auth = $this->createHandler([$a1, $a2]); - - $auth->setKeywordParams(['CRAM-MD5', 'LOGIN']); - $auth->afterEhlo($this->agent); - } - - public function testSeveralAuthenticatorsAreTriedIfNeeded() - { - $a1 = $this->createMockAuthenticator('PLAIN'); - $a2 = $this->createMockAuthenticator('LOGIN'); - - $a1->shouldReceive('authenticate') - ->once() - ->with($this->agent, 'jack', 'pass') - ->andReturn(false); - $a2->shouldReceive('authenticate') - ->once() - ->with($this->agent, 'jack', 'pass') - ->andReturn(true); - - $auth = $this->createHandler([$a1, $a2]); - $auth->setUsername('jack'); - $auth->setPassword('pass'); - - $auth->setKeywordParams(['PLAIN', 'LOGIN']); - $auth->afterEhlo($this->agent); - } - - public function testFirstAuthenticatorToPassBreaksChain() - { - $a1 = $this->createMockAuthenticator('PLAIN'); - $a2 = $this->createMockAuthenticator('LOGIN'); - $a3 = $this->createMockAuthenticator('CRAM-MD5'); - - $a1->shouldReceive('authenticate') - ->once() - ->with($this->agent, 'jack', 'pass') - ->andReturn(false); - $a2->shouldReceive('authenticate') - ->once() - ->with($this->agent, 'jack', 'pass') - ->andReturn(true); - $a3->shouldReceive('authenticate') - ->never() - ->with($this->agent, 'jack', 'pass'); - - $auth = $this->createHandler([$a1, $a2]); - $auth->setUsername('jack'); - $auth->setPassword('pass'); - - $auth->setKeywordParams(['PLAIN', 'LOGIN', 'CRAM-MD5']); - $auth->afterEhlo($this->agent); - } - - private function createHandler($authenticators) - { - return new Swift_Transport_Esmtp_AuthHandler($authenticators); - } - - private function createMockAuthenticator($type) - { - $authenticator = $this->getMockery('Swift_Transport_Esmtp_Authenticator')->shouldIgnoreMissing(); - $authenticator->shouldReceive('getAuthKeyword') - ->zeroOrMoreTimes() - ->andReturn($type); - - return $authenticator; - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php deleted file mode 100644 index d9e363a70..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransport/ExtensionSupportTest.php +++ /dev/null @@ -1,561 +0,0 @@ -getBuffer(); - $smtp = $this->getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('STARTTLS') - ->andReturn(1); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext2->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(-1); - $this->finishBuffer($buf); - - $smtp->setExtensionHandlers([$ext1, $ext2]); - $this->assertEquals([$ext2, $ext1], $smtp->getExtensionHandlers()); - } - - public function testHandlersAreNotifiedOfParams() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .*?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('setKeywordParams') - ->once() - ->with(['PLAIN', 'LOGIN']); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('setKeywordParams') - ->zeroOrMoreTimes() - ->with(['123456']); - $this->finishBuffer($buf); - - $smtp->setExtensionHandlers([$ext1, $ext2]); - $smtp->start(); - } - - public function testSupportedExtensionHandlersAreRunAfterEhlo() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .*?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('afterEhlo') - ->once() - ->with($smtp); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('afterEhlo') - ->zeroOrMoreTimes() - ->with($smtp); - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('afterEhlo') - ->never() - ->with($smtp); - $this->finishBuffer($buf); - - $smtp->setExtensionHandlers([$ext1, $ext2, $ext3]); - $smtp->start(); - } - - public function testExtensionsCanModifyMailFromParams() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(); - $smtp = new Swift_Transport_EsmtpTransport($buf, [], $dispatcher, 'example.org'); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .*?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM: FOO ZIP\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn("250 OK\r\n"); - $this->finishBuffer($buf); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('getMailParams') - ->once() - ->andReturn('FOO'); - $ext1->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('STARTTLS') - ->andReturn(1); - $ext1->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('SIZE') - ->andReturn(-1); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('getMailParams') - ->once() - ->andReturn('ZIP'); - $ext2->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(1); - $ext2->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('STARTTLS') - ->andReturn(1); - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('getMailParams') - ->never(); - $ext3->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(-1); - $ext3->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('SIZE') - ->andReturn(-1); - - $smtp->setExtensionHandlers([$ext1, $ext2, $ext3]); - $smtp->start(); - $smtp->send($message); - } - - public function testExtensionsCanModifyRcptParams() - { - $buf = $this->getBuffer(); - $dispatcher = $this->createEventDispatcher(); - $smtp = new Swift_Transport_EsmtpTransport($buf, [], $dispatcher, 'example.org'); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $message = $this->createMessage(); - - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("RCPT TO: FOO ZIP\r\n") - ->andReturn(3); - $buf->shouldReceive('readLine') - ->once() - ->with(3) - ->andReturn("250 OK\r\n"); - $this->finishBuffer($buf); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('getRcptParams') - ->once() - ->andReturn('FOO'); - $ext1->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('STARTTLS') - ->andReturn(1); - $ext1->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('SIZE') - ->andReturn(-1); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('getRcptParams') - ->once() - ->andReturn('ZIP'); - $ext2->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('STARTTLS') - ->andReturn(1); - $ext2->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(1); - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('getRcptParams') - ->never(); - $ext3->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('AUTH') - ->andReturn(-1); - $ext3->shouldReceive('getPriorityOver') - ->zeroOrMoreTimes() - ->with('SIZE') - ->andReturn(-1); - - $smtp->setExtensionHandlers([$ext1, $ext2, $ext3]); - $smtp->start(); - $smtp->send($message); - } - - public function testExtensionsAreNotifiedOnCommand() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("FOO\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn("250 Cool\r\n"); - $this->finishBuffer($buf); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('onCommand') - ->once() - ->with($smtp, "FOO\r\n", [250, 251], \Mockery::any(), \Mockery::any()); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('onCommand') - ->once() - ->with($smtp, "FOO\r\n", [250, 251], \Mockery::any(), \Mockery::any()); - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('onCommand') - ->never() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $smtp->setExtensionHandlers([$ext1, $ext2, $ext3]); - $smtp->start(); - $smtp->executeCommand("FOO\r\n", [250, 251]); - } - - public function testChainOfCommandAlgorithmWhenNotifyingExtensions() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - $ext3 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 server.com foo\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-ServerName.tld\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250-AUTH PLAIN LOGIN\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn("250 SIZE=123456\r\n"); - $buf->shouldReceive('write') - ->never() - ->with("FOO\r\n"); - $this->finishBuffer($buf); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('onCommand') - ->once() - ->with($smtp, "FOO\r\n", [250, 251], \Mockery::any(), \Mockery::any()) - ->andReturnUsing(function ($a, $b, $c, $d, &$e) { - $e = true; - - return '250 ok'; - }); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('SIZE'); - $ext2->shouldReceive('onCommand') - ->never() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $ext3->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $ext3->shouldReceive('onCommand') - ->never() - ->with(\Mockery::any(), \Mockery::any(), \Mockery::any(), \Mockery::any()); - - $smtp->setExtensionHandlers([$ext1, $ext2, $ext3]); - $smtp->start(); - $smtp->executeCommand("FOO\r\n", [250, 251]); - } - - public function testExtensionsCanExposeMixinMethods() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandlerMixin')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('exposeMixinMethods') - ->zeroOrMoreTimes() - ->andReturn(['setUsername', 'setPassword']); - $ext1->shouldReceive('setUsername') - ->once() - ->with('mick'); - $ext1->shouldReceive('setPassword') - ->once() - ->with('pass'); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $this->finishBuffer($buf); - - $smtp->setExtensionHandlers([$ext1, $ext2]); - $smtp->setUsername('mick'); - $smtp->setPassword('pass'); - } - - public function testMixinMethodsBeginningWithSetAndNullReturnAreFluid() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandlerMixin')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('exposeMixinMethods') - ->zeroOrMoreTimes() - ->andReturn(['setUsername', 'setPassword']); - $ext1->shouldReceive('setUsername') - ->once() - ->with('mick') - ->andReturn(null); - $ext1->shouldReceive('setPassword') - ->once() - ->with('pass') - ->andReturn(null); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $this->finishBuffer($buf); - - $smtp->setExtensionHandlers([$ext1, $ext2]); - $ret = $smtp->setUsername('mick'); - $this->assertEquals($smtp, $ret); - $ret = $smtp->setPassword('pass'); - $this->assertEquals($smtp, $ret); - } - - public function testMixinSetterWhichReturnValuesAreNotFluid() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $ext1 = $this->getMockery('Swift_Transport_EsmtpHandlerMixin')->shouldIgnoreMissing(); - $ext2 = $this->getMockery('Swift_Transport_EsmtpHandler')->shouldIgnoreMissing(); - - $ext1->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('AUTH'); - $ext1->shouldReceive('exposeMixinMethods') - ->zeroOrMoreTimes() - ->andReturn(['setUsername', 'setPassword']); - $ext1->shouldReceive('setUsername') - ->once() - ->with('mick') - ->andReturn('x'); - $ext1->shouldReceive('setPassword') - ->once() - ->with('pass') - ->andReturn('x'); - $ext2->shouldReceive('getHandledKeyword') - ->zeroOrMoreTimes() - ->andReturn('STARTTLS'); - $this->finishBuffer($buf); - - $smtp->setExtensionHandlers([$ext1, $ext2]); - $this->assertEquals('x', $smtp->setUsername('mick')); - $this->assertEquals('x', $smtp->setPassword('pass')); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php deleted file mode 100644 index db1edcef4..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/EsmtpTransportTest.php +++ /dev/null @@ -1,651 +0,0 @@ -createEventDispatcher(); - $addressEncoder = $addressEncoder ?? new Swift_AddressEncoder_IdnAddressEncoder(); - - return new Swift_Transport_EsmtpTransport($buf, [], $dispatcher, 'example.org', $addressEncoder); - } - - public function testHostCanBeSetAndFetched() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $smtp->setHost('foo'); - $this->assertEquals('foo', $smtp->getHost(), '%s: Host should be returned'); - } - - public function testPortCanBeSetAndFetched() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $smtp->setPort(25); - $this->assertEquals(25, $smtp->getPort(), '%s: Port should be returned'); - } - - public function testTimeoutCanBeSetAndFetched() - { - $buf = $this->getBuffer(); - $buf->shouldReceive('setParam') - ->once() - ->with('timeout', 10); - - $smtp = $this->getTransport($buf); - $smtp->setTimeout(10); - $this->assertEquals(10, $smtp->getTimeout(), '%s: Timeout should be returned'); - } - - public function testEncryptionCanBeSetAndFetched() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $smtp->setEncryption('tls'); - $this->assertEquals('tls', $smtp->getEncryption(), '%s: Crypto should be returned'); - } - - public function testStartSendsHeloToInitiate() - { - // previous loop would fail if there is an issue - $this->addToAssertionCount(1); - } - - public function testStartSendsEhloToInitiate() - { - /* -- RFC 2821, 3.2. - - 3.2 Client Initiation - - Once the server has sent the welcoming message and the client has - received it, the client normally sends the EHLO command to the - server, indicating the client's identity. In addition to opening the - session, use of EHLO indicates that the client is able to process - service extensions and requests that the server provide a list of the - extensions it supports. Older SMTP systems which are unable to - support service extensions and contemporary clients which do not - require service extensions in the mail session being initiated, MAY - use HELO instead of EHLO. Servers MUST NOT return the extended - EHLO-style response to a HELO command. For a particular connection - attempt, if the server returns a "command not recognized" response to - EHLO, the client SHOULD be able to fall back and send HELO. - - In the EHLO command the host sending the command identifies itself; - the command may be interpreted as saying "Hello, I am " (and, - in the case of EHLO, "and I support service extension requests"). - - -- RFC 2281, 4.1.1.1. - - ehlo = "EHLO" SP Domain CRLF - helo = "HELO" SP Domain CRLF - - -- RFC 2821, 4.3.2. - - EHLO or HELO - S: 250 - E: 504, 550 - - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 ServerName'."\r\n"); - - $this->finishBuffer($buf); - try { - $smtp->start(); - } catch (Exception $e) { - $this->fail('Starting Esmtp should send EHLO and accept 250 response: '.$e->getMessage()); - } - } - - public function testHeloIsUsedAsFallback() - { - /* -- RFC 2821, 4.1.4. - - If the EHLO command is not acceptable to the SMTP server, 501, 500, - or 502 failure replies MUST be returned as appropriate. The SMTP - server MUST stay in the same state after transmitting these replies - that it was in before the EHLO was received. - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('501 WTF'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^HELO .+?\r\n$~D') - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 HELO'."\r\n"); - - $this->finishBuffer($buf); - try { - $smtp->start(); - } catch (Exception $e) { - $this->fail( - 'Starting Esmtp should fallback to HELO if needed and accept 250 response' - ); - } - } - - public function testInvalidHeloResponseCausesException() - { - //Overridden to first try EHLO - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('501 WTF'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^HELO .+?\r\n$~D') - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('504 WTF'."\r\n"); - $this->finishBuffer($buf); - - try { - $this->assertFalse($smtp->isStarted(), '%s: SMTP should begin non-started'); - $smtp->start(); - $this->fail('Non 250 HELO response should raise Exception'); - } catch (Exception $e) { - $this->assertFalse($smtp->isStarted(), '%s: SMTP start() should have failed'); - } - } - - public function testDomainNameIsPlacedInEhlo() - { - /* -- RFC 2821, 4.1.4. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("EHLO mydomain.com\r\n") - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 ServerName'."\r\n"); - - $this->finishBuffer($buf); - $smtp->setLocalDomain('mydomain.com'); - $smtp->start(); - } - - public function testDomainNameIsPlacedInHelo() - { - //Overridden to include ESMTP - /* -- RFC 2821, 4.1.4. - - The SMTP client MUST, if possible, ensure that the domain parameter - to the EHLO command is a valid principal host name (not a CNAME or MX - name) for its host. If this is not possible (e.g., when the client's - address is dynamically assigned and the client does not have an - obvious name), an address literal SHOULD be substituted for the - domain name and supplemental information provided that will assist in - identifying the client. - */ - - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('501 WTF'."\r\n"); - $buf->shouldReceive('write') - ->once() - ->with("HELO mydomain.com\r\n") - ->andReturn(2); - $buf->shouldReceive('readLine') - ->once() - ->with(2) - ->andReturn('250 ServerName'."\r\n"); - - $this->finishBuffer($buf); - $smtp->setLocalDomain('mydomain.com'); - $smtp->start(); - } - - public function testPipelining() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $this->assertNull($smtp->getPipelining()); - - $message = $this->createMessage(); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250-ServerName'."\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 PIPELINING'."\r\n"); - - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("DATA\r\n")->andReturn(3); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(1)->andReturn("250 OK\r\n"); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(2)->andReturn("250 OK\r\n"); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(3)->andReturn("354 OK\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $sent = $smtp->send($message, $failedRecipients); - - $this->assertEquals(1, $sent); - $this->assertEmpty($failedRecipients); - - $this->assertTrue($smtp->getPipelining()); - } - - public function testPipeliningWithRecipientFailure() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $this->assertNull($smtp->getPipelining()); - - $message = $this->createMessage(); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn([ - 'good@foo' => null, - 'bad@foo' => null, - 'good@bar' => null, - ]); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250-ServerName'."\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 PIPELINING'."\r\n"); - - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(3); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(4); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("DATA\r\n") - ->andReturn(5); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(2) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(3) - ->andReturn("450 Unknown address bad@foo\r\n"); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(4) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(5) - ->andReturn("354 OK\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $sent = $smtp->send($message, $failedRecipients); - - $this->assertEquals(2, $sent); - $this->assertEquals(['bad@foo'], $failedRecipients); - - $this->assertTrue($smtp->getPipelining()); - } - - public function testPipeliningWithSenderFailure() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $this->assertNull($smtp->getPipelining()); - - $message = $this->createMessage(); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250-ServerName'."\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 PIPELINING'."\r\n"); - - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("DATA\r\n")->andReturn(3); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(1) - ->andReturn("550 Unknown address me@domain.com\r\n"); - - $smtp->start(); - - $this->expectException('Swift_TransportException'); - $this->expectExceptionMessage('Expected response code 250 but got code "550"'); - $smtp->send($message, $failedRecipients); - } - - public function testPipeliningWithDataFailure() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $this->assertNull($smtp->getPipelining()); - - $message = $this->createMessage(); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => null]); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250-ServerName'."\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 PIPELINING'."\r\n"); - - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("MAIL FROM:\r\n") - ->andReturn(1); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("RCPT TO:\r\n") - ->andReturn(2); - $buf->shouldReceive('write') - ->ordered() - ->once() - ->with("DATA\r\n")->andReturn(3); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(1) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(2) - ->andReturn("250 OK\r\n"); - $buf->shouldReceive('readLine') - ->ordered() - ->once() - ->with(3) - ->andReturn("452 Insufficient system storage\r\n"); - - $smtp->start(); - - $this->expectException('Swift_TransportException'); - $this->expectExceptionMessage('Expected response code 354 but got code "452"'); - $smtp->send($message, $failedRecipients); - } - - public function providerPipeliningOverride() - { - return [ - [null, true, true], - [null, false, false], - [true, false, true], - [true, true, true], - [false, false, false], - [false, true, false], - ]; - } - - /** - * @dataProvider providerPipeliningOverride - */ - public function testPipeliningOverride($enabled, bool $supported, bool $expected) - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $this->assertNull($smtp->getPipelining()); - - $smtp->setPipelining($enabled); - $this->assertSame($enabled, $smtp->getPipelining()); - - $message = $this->createMessage(); - $message->shouldReceive('getFrom') - ->zeroOrMoreTimes() - ->andReturn(['me@domain.com' => 'Me']); - - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('readLine') - ->once() - ->with(0) - ->andReturn("220 some.server.tld bleh\r\n"); - $buf->shouldReceive('write') - ->once() - ->with('~^EHLO .+?\r\n$~D') - ->andReturn(1); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250-ServerName'."\r\n"); - $buf->shouldReceive('readLine') - ->once() - ->with(1) - ->andReturn('250 '.($supported ? 'PIPELINING' : 'FOOBAR')."\r\n"); - - $this->finishBuffer($buf); - $smtp->start(); - $smtp->send($message); - - $this->assertSame($expected, $smtp->getPipelining()); - } - - public function testFluidInterface() - { - $buf = $this->getBuffer(); - $smtp = $this->getTransport($buf); - $buf->shouldReceive('setParam') - ->once() - ->with('timeout', 30); - - $ref = $smtp - ->setHost('foo') - ->setPort(25) - ->setEncryption('tls') - ->setTimeout(30) - ->setPipelining(false) - ; - $this->assertEquals($ref, $smtp); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php deleted file mode 100644 index deb0617da..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/FailoverTransportTest.php +++ /dev/null @@ -1,600 +0,0 @@ -getMockery('Swift_Mime_SimpleMessage'); - $message2 = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState) { - return $connectionState; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState) { - if (!$connectionState) { - $connectionState = true; - } - }); - $t1->shouldReceive('send') - ->twice() - ->with(\Mockery::anyOf($message1, $message2), \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState) { - if ($connectionState) { - return 1; - } - }); - $t2->shouldReceive('start')->never(); - $t2->shouldReceive('send')->never(); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - } - - public function testMessageCanBeTriedOnNextTransportIfExceptionThrown() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - return 1; - } - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertEquals(1, $transport->send($message)); - } - - public function testZeroIsReturnedIfTransportReturnsZero() - { - $message = $this->getMockery('Swift_Mime_SimpleMessage')->shouldIgnoreMissing(); - $t1 = $this->getMockery('Swift_Transport')->shouldIgnoreMissing(); - - $connectionState = false; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState) { - return $connectionState; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState) { - if (!$connectionState) { - $connectionState = true; - } - }); - $testCase = $this; - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState, $testCase) { - if (!$connectionState) { - $testCase->fail(); - } - - return 0; - }); - - $transport = $this->getTransport([$t1]); - $transport->start(); - $this->assertEquals(0, $transport->send($message)); - } - - public function testTransportsWhichThrowExceptionsAreNotRetried() - { - $e = new Swift_TransportException('maur b0rken'); - - $message1 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message2 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message3 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message4 = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - $t1->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - $t1->shouldReceive('send') - ->never() - ->with($message3, \Mockery::any()); - $t1->shouldReceive('send') - ->never() - ->with($message4, \Mockery::any()); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->times(4) - ->with(\Mockery::anyOf($message1, $message2, $message3, $message4), \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - return 1; - } - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - $this->assertEquals(1, $transport->send($message3)); - $this->assertEquals(1, $transport->send($message4)); - } - - public function testExceptionIsThrownIfAllTransportsDie() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - throw $e; - } - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - } - } - - public function testStoppingTransportStopsAllDelegates() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $connectionState1 = true; - $connectionState2 = true; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('stop') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - $connectionState1 = false; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('stop') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if ($connectionState2) { - $connectionState2 = false; - } - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $transport->stop(); - } - - public function testTransportShowsAsNotStartedIfAllDelegatesDead() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - $connectionState1 = false; - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - $connectionState2 = false; - throw $e; - } - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - } - - public function testRestartingTransportRestartsDeadDelegates() - { - $e = new Swift_TransportException('b0rken'); - - $message1 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message2 = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->twice() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - $connectionState1 = false; - throw $e; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message2, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - return 10; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - $connectionState2 = false; - throw $e; - } - }); - $t2->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message1); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - //Restart and re-try - $transport->start(); - $this->assertTrue($transport->isStarted()); - $this->assertEquals(10, $transport->send($message2)); - } - - public function testFailureReferenceIsPassedToDelegates() - { - $failures = []; - - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - - $connectionState = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use ($connectionState) { - return $connectionState; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use ($connectionState) { - if (!$connectionState) { - $connectionState = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, $failures) - ->andReturnUsing(function () use ($connectionState) { - if ($connectionState) { - return 1; - } - }); - - $transport = $this->getTransport([$t1]); - $transport->start(); - $transport->send($message, $failures); - } - - public function testRegisterPluginDelegatesToLoadedTransports() - { - $plugin = $this->createPlugin(); - - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $t1->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - $t2->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - - $transport = $this->getTransport([$t1, $t2]); - $transport->registerPlugin($plugin); - } - - public function testEachDelegateIsPinged() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('ping') - ->once() - ->andReturn(true); - - $transport = $this->getTransport([$t1, $t2]); - $this->assertTrue($transport->isStarted()); - $this->assertTrue($transport->ping()); - } - - public function testDelegateIsKilledWhenPingFails() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('ping') - ->once() - ->andReturn(false); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('ping') - ->twice() - ->andReturn(true); - - $transport = $this->getTransport([$t1, $t2]); - $this->assertTrue($transport->ping()); - $this->assertTrue($transport->ping()); - $this->assertTrue($transport->isStarted()); - } - - public function XtestTransportShowsAsNotStartedIfAllPingFails() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('ping') - ->once() - ->andReturn(false); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('ping') - ->once() - ->andReturn(false); - - $transport = $this->getTransport([$t1, $t2]); - $this->assertFalse($transport->ping()); - $this->assertFalse($transport->isStarted()); - $this->assertFalse($transport->ping()); - } - - private function getTransport(array $transports) - { - $transport = new Swift_Transport_FailoverTransport(); - $transport->setTransports($transports); - - return $transport; - } - - private function createPlugin() - { - return $this->getMockery('Swift_Events_EventListener'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php deleted file mode 100644 index dbc60afa7..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/LoadBalancedTransportTest.php +++ /dev/null @@ -1,838 +0,0 @@ -getMockery('Swift_Mime_SimpleMessage'); - $message2 = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $testCase) { - if ($connectionState1) { - return 1; - } - $testCase->fail(); - }); - $t1->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message2, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - $t2->shouldReceive('send') - ->never() - ->with($message1, \Mockery::any()); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - } - - public function testTransportsAreReusedInRotatingFashion() - { - $message1 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message2 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message3 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message4 = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $testCase) { - if ($connectionState1) { - return 1; - } - $testCase->fail(); - }); - $t1->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - $t1->shouldReceive('send') - ->once() - ->with($message3, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $testCase) { - if ($connectionState1) { - return 1; - } - $testCase->fail(); - }); - $t1->shouldReceive('send') - ->never() - ->with($message4, \Mockery::any()); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message2, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - $t2->shouldReceive('send') - ->never() - ->with($message1, \Mockery::any()); - $t2->shouldReceive('send') - ->once() - ->with($message4, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - $t2->shouldReceive('send') - ->never() - ->with($message3, \Mockery::any()); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - $this->assertEquals(1, $transport->send($message3)); - $this->assertEquals(1, $transport->send($message4)); - } - - public function testMessageCanBeTriedOnNextTransportIfExceptionThrown() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e, $testCase) { - if ($connectionState1) { - throw $e; - } - $testCase->fail(); - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertEquals(1, $transport->send($message)); - } - - public function testMessageIsTriedOnNextTransportIfZeroReturned() - { - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - return 0; - } - - return 1; - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2) { - if ($connectionState2) { - return 1; - } - - return 0; - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertEquals(1, $transport->send($message)); - } - - public function testZeroIsReturnedIfAllTransportsReturnZero() - { - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - return 0; - } - - return 1; - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2) { - if ($connectionState2) { - return 0; - } - - return 1; - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertEquals(0, $transport->send($message)); - } - - public function testTransportsWhichThrowExceptionsAreNotRetried() - { - $e = new Swift_TransportException('maur b0rken'); - - $message1 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message2 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message3 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message4 = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e, $testCase) { - if ($connectionState1) { - throw $e; - } - $testCase->fail(); - }); - $t1->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - $t1->shouldReceive('send') - ->never() - ->with($message3, \Mockery::any()); - $t1->shouldReceive('send') - ->never() - ->with($message4, \Mockery::any()); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->times(4) - ->with(\Mockery::anyOf($message1, $message3, $message3, $message4), \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $testCase) { - if ($connectionState2) { - return 1; - } - $testCase->fail(); - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertEquals(1, $transport->send($message1)); - $this->assertEquals(1, $transport->send($message2)); - $this->assertEquals(1, $transport->send($message3)); - $this->assertEquals(1, $transport->send($message4)); - } - - public function testExceptionIsThrownIfAllTransportsDie() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - throw $e; - } - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - } - } - - public function testStoppingTransportStopsAllDelegates() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = true; - $connectionState2 = true; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('stop') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if ($connectionState1) { - $connectionState1 = false; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('stop') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if ($connectionState2) { - $connectionState2 = false; - } - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $transport->stop(); - } - - public function testTransportShowsAsNotStartedIfAllDelegatesDead() - { - $e = new Swift_TransportException('b0rken'); - - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - throw $e; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - throw $e; - } - }); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - } - - public function testRestartingTransportRestartsDeadDelegates() - { - $e = new Swift_TransportException('b0rken'); - - $message1 = $this->getMockery('Swift_Mime_SimpleMessage'); - $message2 = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - $connectionState1 = false; - $connectionState2 = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('start') - ->twice() - ->andReturnUsing(function () use (&$connectionState1) { - if (!$connectionState1) { - $connectionState1 = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - $connectionState1 = false; - throw $e; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message2, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState1, $e) { - if ($connectionState1) { - return 10; - } - }); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState2) { - if (!$connectionState2) { - $connectionState2 = true; - } - }); - $t2->shouldReceive('send') - ->once() - ->with($message1, \Mockery::any()) - ->andReturnUsing(function () use (&$connectionState2, $e) { - if ($connectionState2) { - throw $e; - } - }); - $t2->shouldReceive('send') - ->never() - ->with($message2, \Mockery::any()); - - $transport = $this->getTransport([$t1, $t2]); - $transport->start(); - $this->assertTrue($transport->isStarted()); - try { - $transport->send($message1); - $this->fail('All transports failed so Exception should be thrown'); - } catch (Exception $e) { - $this->assertFalse($transport->isStarted()); - } - //Restart and re-try - $transport->start(); - $this->assertTrue($transport->isStarted()); - $this->assertEquals(10, $transport->send($message2)); - } - - public function testFailureReferenceIsPassedToDelegates() - { - $failures = []; - $testCase = $this; - - $message = $this->getMockery('Swift_Mime_SimpleMessage'); - $t1 = $this->getMockery('Swift_Transport'); - $connectionState = false; - - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState) { - return $connectionState; - }); - $t1->shouldReceive('start') - ->once() - ->andReturnUsing(function () use (&$connectionState) { - if (!$connectionState) { - $connectionState = true; - } - }); - $t1->shouldReceive('send') - ->once() - ->with($message, \Mockery::on(function (&$var) use (&$failures, $testCase) { - return $testCase->varsAreReferences($var, $failures); - })) - ->andReturnUsing(function () use (&$connectionState) { - if ($connectionState) { - return 1; - } - }); - - $transport = $this->getTransport([$t1]); - $transport->start(); - $transport->send($message, $failures); - } - - public function testRegisterPluginDelegatesToLoadedTransports() - { - $plugin = $this->createPlugin(); - - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $t1->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - $t2->shouldReceive('registerPlugin') - ->once() - ->with($plugin); - - $transport = $this->getTransport([$t1, $t2]); - $transport->registerPlugin($plugin); - } - - public function testEachDelegateIsPinged() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('ping') - ->once() - ->andReturn(true); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('ping') - ->once() - ->andReturn(true); - - $transport = $this->getTransport([$t1, $t2]); - $this->assertTrue($transport->isStarted()); - $this->assertTrue($transport->ping()); - } - - public function testDelegateIsKilledWhenPingFails() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('ping') - ->twice() - ->andReturn(true); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('ping') - ->once() - ->andReturn(false); - - $transport = $this->getTransport([$t1, $t2]); - $this->assertTrue($transport->ping()); - $this->assertTrue($transport->ping()); - $this->assertTrue($transport->isStarted()); - } - - public function testTransportShowsAsNotStartedIfAllPingFails() - { - $t1 = $this->getMockery('Swift_Transport'); - $t2 = $this->getMockery('Swift_Transport'); - - $testCase = $this; - $t1->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState1) { - return $connectionState1; - }); - $t1->shouldReceive('ping') - ->once() - ->andReturn(false); - - $t2->shouldReceive('isStarted') - ->zeroOrMoreTimes() - ->andReturnUsing(function () use (&$connectionState2) { - return $connectionState2; - }); - $t2->shouldReceive('ping') - ->once() - ->andReturn(false); - - $transport = $this->getTransport([$t1, $t2]); - $this->assertFalse($transport->ping()); - $this->assertFalse($transport->isStarted()); - $this->assertFalse($transport->ping()); - } - - /** - * Adapted from Yay_Matchers_ReferenceMatcher. - */ - public function varsAreReferences(&$ref1, &$ref2) - { - if (is_object($ref2)) { - return $ref1 === $ref2; - } - if ($ref1 !== $ref2) { - return false; - } - - $copy = $ref2; - $randomString = uniqid('yay', true); - $ref2 = $randomString; - $isRef = ($ref1 === $ref2); - $ref2 = $copy; - - return $isRef; - } - - private function getTransport(array $transports) - { - $transport = new Swift_Transport_LoadBalancedTransport(); - $transport->setTransports($transports); - - return $transport; - } - - private function createPlugin() - { - return $this->getMockery('Swift_Events_EventListener'); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php deleted file mode 100644 index fe40d6c8a..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/SendmailTransportTest.php +++ /dev/null @@ -1,150 +0,0 @@ -createEventDispatcher(); - } - $transport = new Swift_Transport_SendmailTransport($buf, $dispatcher, 'example.org', $addressEncoder); - $transport->setCommand($command); - - return $transport; - } - - protected function getSendmail($buf, $dispatcher = null) - { - if (!$dispatcher) { - $dispatcher = $this->createEventDispatcher(); - } - - return new Swift_Transport_SendmailTransport($buf, $dispatcher); - } - - public function testCommandCanBeSetAndFetched() - { - $buf = $this->getBuffer(); - $sendmail = $this->getSendmail($buf); - - $sendmail->setCommand('/usr/sbin/sendmail -bs'); - $this->assertEquals('/usr/sbin/sendmail -bs', $sendmail->getCommand()); - $sendmail->setCommand('/usr/sbin/sendmail -oi -t'); - $this->assertEquals('/usr/sbin/sendmail -oi -t', $sendmail->getCommand()); - } - - public function testSendingMessageIn_t_ModeUsesSimplePipe() - { - $buf = $this->getBuffer(); - $sendmail = $this->getSendmail($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => 'Foobar', 'zip@button' => 'Zippy']); - $message->shouldReceive('toByteStream') - ->once() - ->with($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('terminate') - ->once(); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(["\r\n" => "\n", "\n." => "\n.."]); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with([]); - - $sendmail->setCommand('/usr/sbin/sendmail -t'); - $this->assertEquals(2, $sendmail->send($message)); - } - - public function testSendingIn_t_ModeWith_i_FlagDoesntEscapeDot() - { - $buf = $this->getBuffer(); - $sendmail = $this->getSendmail($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => 'Foobar', 'zip@button' => 'Zippy']); - $message->shouldReceive('toByteStream') - ->once() - ->with($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('terminate') - ->once(); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(["\r\n" => "\n"]); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with([]); - - $sendmail->setCommand('/usr/sbin/sendmail -i -t'); - $this->assertEquals(2, $sendmail->send($message)); - } - - public function testSendingInTModeWith_oi_FlagDoesntEscapeDot() - { - $buf = $this->getBuffer(); - $sendmail = $this->getSendmail($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => 'Foobar', 'zip@button' => 'Zippy']); - $message->shouldReceive('toByteStream') - ->once() - ->with($buf); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('terminate') - ->once(); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(["\r\n" => "\n"]); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with([]); - - $sendmail->setCommand('/usr/sbin/sendmail -oi -t'); - $this->assertEquals(2, $sendmail->send($message)); - } - - public function testSendingMessageRegeneratesId() - { - $buf = $this->getBuffer(); - $sendmail = $this->getSendmail($buf); - $message = $this->createMessage(); - - $message->shouldReceive('getTo') - ->zeroOrMoreTimes() - ->andReturn(['foo@bar' => 'Foobar', 'zip@button' => 'Zippy']); - $message->shouldReceive('generateId'); - $buf->shouldReceive('initialize') - ->once(); - $buf->shouldReceive('terminate') - ->once(); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with(["\r\n" => "\n", "\n." => "\n.."]); - $buf->shouldReceive('setWriteTranslations') - ->once() - ->with([]); - - $sendmail->setCommand('/usr/sbin/sendmail -t'); - $this->assertEquals(2, $sendmail->send($message)); - } - - public function testFluidInterface() - { - $buf = $this->getBuffer(); - $sendmail = $this->getTransport($buf); - - $ref = $sendmail->setCommand('/foo'); - $this->assertEquals($ref, $sendmail); - } -} diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php deleted file mode 100644 index 540709afc..000000000 --- a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Transport/StreamBufferTest.php +++ /dev/null @@ -1,43 +0,0 @@ -createFactory(); - $factory->expects($this->once()) - ->method('createFilter') - ->with('a', 'b') - ->will($this->returnCallback([$this, 'createFilter'])); - - $buffer = $this->createBuffer($factory); - $buffer->setWriteTranslations(['a' => 'b']); - } - - public function testOverridingTranslationsOnlyAddsNeededFilters() - { - $factory = $this->createFactory(); - $factory->expects($this->exactly(2)) - ->method('createFilter') - ->will($this->returnCallback([$this, 'createFilter'])); - - $buffer = $this->createBuffer($factory); - $buffer->setWriteTranslations(['a' => 'b']); - $buffer->setWriteTranslations(['x' => 'y', 'a' => 'b']); - } - - private function createBuffer($replacementFactory) - { - return new Swift_Transport_StreamBuffer($replacementFactory); - } - - private function createFactory() - { - return $this->getMockBuilder('Swift_ReplacementFilterFactory')->getMock(); - } - - public function createFilter() - { - return $this->getMockBuilder('Swift_StreamFilter')->getMock(); - } -} diff --git a/vendor/symfony/console/CHANGELOG.md b/vendor/symfony/console/CHANGELOG.md index 482c8cd36..515924455 100644 --- a/vendor/symfony/console/CHANGELOG.md +++ b/vendor/symfony/console/CHANGELOG.md @@ -47,9 +47,9 @@ CHANGELOG * `OutputFormatter` throws an exception when unknown options are used * removed `QuestionHelper::setInputStream()/getInputStream()` * removed `Application::getTerminalWidth()/getTerminalHeight()` and - `Application::setTerminalDimensions()/getTerminalDimensions()` -* removed `ConsoleExceptionEvent` -* removed `ConsoleEvents::EXCEPTION` + `Application::setTerminalDimensions()/getTerminalDimensions()` + * removed `ConsoleExceptionEvent` + * removed `ConsoleEvents::EXCEPTION` 3.4.0 ----- @@ -66,23 +66,23 @@ CHANGELOG 3.3.0 ----- -* added `ExceptionListener` -* added `AddConsoleCommandPass` (originally in FrameworkBundle) -* [BC BREAK] `Input::getOption()` no longer returns the default value for options - with value optional explicitly passed empty -* added console.error event to catch exceptions thrown by other listeners -* deprecated console.exception event in favor of console.error -* added ability to handle `CommandNotFoundException` through the - `console.error` event -* deprecated default validation in `SymfonyQuestionHelper::ask` + * added `ExceptionListener` + * added `AddConsoleCommandPass` (originally in FrameworkBundle) + * [BC BREAK] `Input::getOption()` no longer returns the default value for options + with value optional explicitly passed empty + * added console.error event to catch exceptions thrown by other listeners + * deprecated console.exception event in favor of console.error + * added ability to handle `CommandNotFoundException` through the + `console.error` event + * deprecated default validation in `SymfonyQuestionHelper::ask` 3.2.0 ------ -* added `setInputs()` method to CommandTester for ease testing of commands expecting inputs -* added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) -* added StreamableInputInterface -* added LockableTrait + * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs + * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) + * added StreamableInputInterface + * added LockableTrait 3.1.0 ----- diff --git a/vendor/symfony/console/ConsoleEvents.php b/vendor/symfony/console/ConsoleEvents.php index 4975643ae..f3c6cad5a 100644 --- a/vendor/symfony/console/ConsoleEvents.php +++ b/vendor/symfony/console/ConsoleEvents.php @@ -25,7 +25,7 @@ final class ConsoleEvents * * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") */ - const COMMAND = 'console.command'; + public const COMMAND = 'console.command'; /** * The TERMINATE event allows you to attach listeners after a command is @@ -33,7 +33,7 @@ final class ConsoleEvents * * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") */ - const TERMINATE = 'console.terminate'; + public const TERMINATE = 'console.terminate'; /** * The ERROR event occurs when an uncaught exception or error appears. @@ -43,5 +43,5 @@ final class ConsoleEvents * * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") */ - const ERROR = 'console.error'; + public const ERROR = 'console.error'; } diff --git a/vendor/symfony/console/Descriptor/ApplicationDescription.php b/vendor/symfony/console/Descriptor/ApplicationDescription.php index d361b4890..3192c0f6f 100644 --- a/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -22,7 +22,7 @@ use Symfony\Component\Console\Exception\CommandNotFoundException; */ class ApplicationDescription { - const GLOBAL_NAMESPACE = '_global'; + public const GLOBAL_NAMESPACE = '_global'; private $application; private $namespace; diff --git a/vendor/symfony/console/Event/ConsoleCommandEvent.php b/vendor/symfony/console/Event/ConsoleCommandEvent.php index 79a51906a..9691db636 100644 --- a/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ b/vendor/symfony/console/Event/ConsoleCommandEvent.php @@ -23,7 +23,7 @@ class ConsoleCommandEvent extends ConsoleEvent /** * The return code for skipped commands, this will also be passed into the terminate event. */ - const RETURN_CODE_DISABLED = 113; + public const RETURN_CODE_DISABLED = 113; /** * Indicates if the command should be run or skipped. diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Formatter/OutputFormatterStyle.php index 272c3e6a2..7cb6116b4 100644 --- a/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -166,7 +166,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface $unsetCodes = []; if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') && !getenv('KONSOLE_VERSION'); + $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); } if (null !== $this->foreground) { diff --git a/vendor/symfony/console/Input/InputArgument.php b/vendor/symfony/console/Input/InputArgument.php index b6aa6452a..140c86d0e 100644 --- a/vendor/symfony/console/Input/InputArgument.php +++ b/vendor/symfony/console/Input/InputArgument.php @@ -21,9 +21,9 @@ use Symfony\Component\Console\Exception\LogicException; */ class InputArgument { - const REQUIRED = 1; - const OPTIONAL = 2; - const IS_ARRAY = 4; + public const REQUIRED = 1; + public const OPTIONAL = 2; + public const IS_ARRAY = 4; private $name; private $mode; diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php index d62e0aea0..66f857a6c 100644 --- a/vendor/symfony/console/Input/InputOption.php +++ b/vendor/symfony/console/Input/InputOption.php @@ -21,10 +21,10 @@ use Symfony\Component\Console\Exception\LogicException; */ class InputOption { - const VALUE_NONE = 1; - const VALUE_REQUIRED = 2; - const VALUE_OPTIONAL = 4; - const VALUE_IS_ARRAY = 8; + public const VALUE_NONE = 1; + public const VALUE_REQUIRED = 2; + public const VALUE_OPTIONAL = 4; + public const VALUE_IS_ARRAY = 8; private $name; private $shortcut; diff --git a/vendor/symfony/console/Input/StringInput.php b/vendor/symfony/console/Input/StringInput.php index 6fddf6488..2890b0f5f 100644 --- a/vendor/symfony/console/Input/StringInput.php +++ b/vendor/symfony/console/Input/StringInput.php @@ -24,8 +24,8 @@ use Symfony\Component\Console\Exception\InvalidArgumentException; */ class StringInput extends ArgvInput { - const REGEX_STRING = '([^\s]+?)(?:\s|(?, ', &, and " characters in the JSON, making it also safe to be embedded into HTML. // 15 === JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT - const DEFAULT_ENCODING_OPTIONS = 15; + public const DEFAULT_ENCODING_OPTIONS = 15; protected $encodingOptions = self::DEFAULT_ENCODING_OPTIONS; @@ -43,6 +43,10 @@ class JsonResponse extends Response { parent::__construct('', $status, $headers); + if ($json && !\is_string($data) && !is_numeric($data) && !\is_callable([$data, '__toString'])) { + throw new \TypeError(sprintf('"%s": If $json is set to true, argument $data must be a string or object implementing __toString(), "%s" given.', __METHOD__, get_debug_type($data))); + } + if (null === $data) { $data = new \ArrayObject(); } @@ -77,13 +81,13 @@ class JsonResponse extends Response * return JsonResponse::fromJsonString('{"key": "value"}') * ->setSharedMaxAge(300); * - * @param string|null $data The JSON response string - * @param int $status The response status code - * @param array $headers An array of response headers + * @param string $data The JSON response string + * @param int $status The response status code + * @param array $headers An array of response headers * * @return static */ - public static function fromJsonString($data = null, $status = 200, $headers = []) + public static function fromJsonString($data, $status = 200, $headers = []) { return new static($data, $status, $headers, true); } @@ -129,8 +133,6 @@ class JsonResponse extends Response * @param string $json * * @return $this - * - * @throws \InvalidArgumentException */ public function setJson($json) { diff --git a/vendor/symfony/http-foundation/Request.php b/vendor/symfony/http-foundation/Request.php index 14775fdef..1f89b2db3 100644 --- a/vendor/symfony/http-foundation/Request.php +++ b/vendor/symfony/http-foundation/Request.php @@ -38,24 +38,24 @@ class_exists(ServerBag::class); */ class Request { - const HEADER_FORWARDED = 0b00001; // When using RFC 7239 - const HEADER_X_FORWARDED_FOR = 0b00010; - const HEADER_X_FORWARDED_HOST = 0b00100; - const HEADER_X_FORWARDED_PROTO = 0b01000; - const HEADER_X_FORWARDED_PORT = 0b10000; - const HEADER_X_FORWARDED_ALL = 0b11110; // All "X-Forwarded-*" headers - const HEADER_X_FORWARDED_AWS_ELB = 0b11010; // AWS ELB doesn't send X-Forwarded-Host + public const HEADER_FORWARDED = 0b00001; // When using RFC 7239 + public const HEADER_X_FORWARDED_FOR = 0b00010; + public const HEADER_X_FORWARDED_HOST = 0b00100; + public const HEADER_X_FORWARDED_PROTO = 0b01000; + public const HEADER_X_FORWARDED_PORT = 0b10000; + public const HEADER_X_FORWARDED_ALL = 0b11110; // All "X-Forwarded-*" headers + public const HEADER_X_FORWARDED_AWS_ELB = 0b11010; // AWS ELB doesn't send X-Forwarded-Host - const METHOD_HEAD = 'HEAD'; - const METHOD_GET = 'GET'; - const METHOD_POST = 'POST'; - const METHOD_PUT = 'PUT'; - const METHOD_PATCH = 'PATCH'; - const METHOD_DELETE = 'DELETE'; - const METHOD_PURGE = 'PURGE'; - const METHOD_OPTIONS = 'OPTIONS'; - const METHOD_TRACE = 'TRACE'; - const METHOD_CONNECT = 'CONNECT'; + public const METHOD_HEAD = 'HEAD'; + public const METHOD_GET = 'GET'; + public const METHOD_POST = 'POST'; + public const METHOD_PUT = 'PUT'; + public const METHOD_PATCH = 'PATCH'; + public const METHOD_DELETE = 'DELETE'; + public const METHOD_PURGE = 'PURGE'; + public const METHOD_OPTIONS = 'OPTIONS'; + public const METHOD_TRACE = 'TRACE'; + public const METHOD_CONNECT = 'CONNECT'; /** * @var string[] @@ -504,15 +504,7 @@ class Request */ public function __toString() { - try { - $content = $this->getContent(); - } catch (\LogicException $e) { - if (\PHP_VERSION_ID >= 70400) { - throw $e; - } - - return trigger_error($e, \E_USER_ERROR); - } + $content = $this->getContent(); $cookieHeader = ''; $cookies = []; @@ -577,8 +569,6 @@ class Request * * @param array $proxies A list of trusted proxies, the string 'REMOTE_ADDR' will be replaced with $_SERVER['REMOTE_ADDR'] * @param int $trustedHeaderSet A bit field of Request::HEADER_*, to set which headers to trust from your proxies - * - * @throws \InvalidArgumentException When $trustedHeaderSet is invalid */ public static function setTrustedProxies(array $proxies, int $trustedHeaderSet) { @@ -1527,8 +1517,6 @@ class Request * @param bool $asResource If true, a resource will be returned * * @return string|resource The request body content or a resource to read the body stream - * - * @throws \LogicException */ public function getContent($asResource = false) { diff --git a/vendor/symfony/http-foundation/Response.php b/vendor/symfony/http-foundation/Response.php index e64b27294..14c365285 100644 --- a/vendor/symfony/http-foundation/Response.php +++ b/vendor/symfony/http-foundation/Response.php @@ -21,74 +21,74 @@ class_exists(ResponseHeaderBag::class); */ class Response { - const HTTP_CONTINUE = 100; - const HTTP_SWITCHING_PROTOCOLS = 101; - const HTTP_PROCESSING = 102; // RFC2518 - const HTTP_EARLY_HINTS = 103; // RFC8297 - const HTTP_OK = 200; - const HTTP_CREATED = 201; - const HTTP_ACCEPTED = 202; - const HTTP_NON_AUTHORITATIVE_INFORMATION = 203; - const HTTP_NO_CONTENT = 204; - const HTTP_RESET_CONTENT = 205; - const HTTP_PARTIAL_CONTENT = 206; - const HTTP_MULTI_STATUS = 207; // RFC4918 - const HTTP_ALREADY_REPORTED = 208; // RFC5842 - const HTTP_IM_USED = 226; // RFC3229 - const HTTP_MULTIPLE_CHOICES = 300; - const HTTP_MOVED_PERMANENTLY = 301; - const HTTP_FOUND = 302; - const HTTP_SEE_OTHER = 303; - const HTTP_NOT_MODIFIED = 304; - const HTTP_USE_PROXY = 305; - const HTTP_RESERVED = 306; - const HTTP_TEMPORARY_REDIRECT = 307; - const HTTP_PERMANENTLY_REDIRECT = 308; // RFC7238 - const HTTP_BAD_REQUEST = 400; - const HTTP_UNAUTHORIZED = 401; - const HTTP_PAYMENT_REQUIRED = 402; - const HTTP_FORBIDDEN = 403; - const HTTP_NOT_FOUND = 404; - const HTTP_METHOD_NOT_ALLOWED = 405; - const HTTP_NOT_ACCEPTABLE = 406; - const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; - const HTTP_REQUEST_TIMEOUT = 408; - const HTTP_CONFLICT = 409; - const HTTP_GONE = 410; - const HTTP_LENGTH_REQUIRED = 411; - const HTTP_PRECONDITION_FAILED = 412; - const HTTP_REQUEST_ENTITY_TOO_LARGE = 413; - const HTTP_REQUEST_URI_TOO_LONG = 414; - const HTTP_UNSUPPORTED_MEDIA_TYPE = 415; - const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; - const HTTP_EXPECTATION_FAILED = 417; - const HTTP_I_AM_A_TEAPOT = 418; // RFC2324 - const HTTP_MISDIRECTED_REQUEST = 421; // RFC7540 - const HTTP_UNPROCESSABLE_ENTITY = 422; // RFC4918 - const HTTP_LOCKED = 423; // RFC4918 - const HTTP_FAILED_DEPENDENCY = 424; // RFC4918 + public const HTTP_CONTINUE = 100; + public const HTTP_SWITCHING_PROTOCOLS = 101; + public const HTTP_PROCESSING = 102; // RFC2518 + public const HTTP_EARLY_HINTS = 103; // RFC8297 + public const HTTP_OK = 200; + public const HTTP_CREATED = 201; + public const HTTP_ACCEPTED = 202; + public const HTTP_NON_AUTHORITATIVE_INFORMATION = 203; + public const HTTP_NO_CONTENT = 204; + public const HTTP_RESET_CONTENT = 205; + public const HTTP_PARTIAL_CONTENT = 206; + public const HTTP_MULTI_STATUS = 207; // RFC4918 + public const HTTP_ALREADY_REPORTED = 208; // RFC5842 + public const HTTP_IM_USED = 226; // RFC3229 + public const HTTP_MULTIPLE_CHOICES = 300; + public const HTTP_MOVED_PERMANENTLY = 301; + public const HTTP_FOUND = 302; + public const HTTP_SEE_OTHER = 303; + public const HTTP_NOT_MODIFIED = 304; + public const HTTP_USE_PROXY = 305; + public const HTTP_RESERVED = 306; + public const HTTP_TEMPORARY_REDIRECT = 307; + public const HTTP_PERMANENTLY_REDIRECT = 308; // RFC7238 + public const HTTP_BAD_REQUEST = 400; + public const HTTP_UNAUTHORIZED = 401; + public const HTTP_PAYMENT_REQUIRED = 402; + public const HTTP_FORBIDDEN = 403; + public const HTTP_NOT_FOUND = 404; + public const HTTP_METHOD_NOT_ALLOWED = 405; + public const HTTP_NOT_ACCEPTABLE = 406; + public const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; + public const HTTP_REQUEST_TIMEOUT = 408; + public const HTTP_CONFLICT = 409; + public const HTTP_GONE = 410; + public const HTTP_LENGTH_REQUIRED = 411; + public const HTTP_PRECONDITION_FAILED = 412; + public const HTTP_REQUEST_ENTITY_TOO_LARGE = 413; + public const HTTP_REQUEST_URI_TOO_LONG = 414; + public const HTTP_UNSUPPORTED_MEDIA_TYPE = 415; + public const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; + public const HTTP_EXPECTATION_FAILED = 417; + public const HTTP_I_AM_A_TEAPOT = 418; // RFC2324 + public const HTTP_MISDIRECTED_REQUEST = 421; // RFC7540 + public const HTTP_UNPROCESSABLE_ENTITY = 422; // RFC4918 + public const HTTP_LOCKED = 423; // RFC4918 + public const HTTP_FAILED_DEPENDENCY = 424; // RFC4918 /** * @deprecated */ - const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; // RFC2817 - const HTTP_TOO_EARLY = 425; // RFC-ietf-httpbis-replay-04 - const HTTP_UPGRADE_REQUIRED = 426; // RFC2817 - const HTTP_PRECONDITION_REQUIRED = 428; // RFC6585 - const HTTP_TOO_MANY_REQUESTS = 429; // RFC6585 - const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC6585 - const HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; - const HTTP_INTERNAL_SERVER_ERROR = 500; - const HTTP_NOT_IMPLEMENTED = 501; - const HTTP_BAD_GATEWAY = 502; - const HTTP_SERVICE_UNAVAILABLE = 503; - const HTTP_GATEWAY_TIMEOUT = 504; - const HTTP_VERSION_NOT_SUPPORTED = 505; - const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; // RFC2295 - const HTTP_INSUFFICIENT_STORAGE = 507; // RFC4918 - const HTTP_LOOP_DETECTED = 508; // RFC5842 - const HTTP_NOT_EXTENDED = 510; // RFC2774 - const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; // RFC6585 + public const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; // RFC2817 + public const HTTP_TOO_EARLY = 425; // RFC-ietf-httpbis-replay-04 + public const HTTP_UPGRADE_REQUIRED = 426; // RFC2817 + public const HTTP_PRECONDITION_REQUIRED = 428; // RFC6585 + public const HTTP_TOO_MANY_REQUESTS = 429; // RFC6585 + public const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC6585 + public const HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; + public const HTTP_INTERNAL_SERVER_ERROR = 500; + public const HTTP_NOT_IMPLEMENTED = 501; + public const HTTP_BAD_GATEWAY = 502; + public const HTTP_SERVICE_UNAVAILABLE = 503; + public const HTTP_GATEWAY_TIMEOUT = 504; + public const HTTP_VERSION_NOT_SUPPORTED = 505; + public const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; // RFC2295 + public const HTTP_INSUFFICIENT_STORAGE = 507; // RFC4918 + public const HTTP_LOOP_DETECTED = 508; // RFC5842 + public const HTTP_NOT_EXTENDED = 510; // RFC2774 + public const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; // RFC6585 /** * @var ResponseHeaderBag diff --git a/vendor/symfony/http-foundation/ResponseHeaderBag.php b/vendor/symfony/http-foundation/ResponseHeaderBag.php index e71034aba..3c5889cac 100644 --- a/vendor/symfony/http-foundation/ResponseHeaderBag.php +++ b/vendor/symfony/http-foundation/ResponseHeaderBag.php @@ -18,11 +18,11 @@ namespace Symfony\Component\HttpFoundation; */ class ResponseHeaderBag extends HeaderBag { - const COOKIES_FLAT = 'flat'; - const COOKIES_ARRAY = 'array'; + public const COOKIES_FLAT = 'flat'; + public const COOKIES_ARRAY = 'array'; - const DISPOSITION_ATTACHMENT = 'attachment'; - const DISPOSITION_INLINE = 'inline'; + public const DISPOSITION_ATTACHMENT = 'attachment'; + public const DISPOSITION_INLINE = 'inline'; protected $computedCacheControl = []; protected $cookies = []; diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php index 01b412051..e579c4ab1 100644 --- a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php @@ -46,7 +46,7 @@ class PdoSessionHandler extends AbstractSessionHandler * write will win in this case. It might be useful when you implement your own * logic to deal with this like an optimistic approach. */ - const LOCK_NONE = 0; + public const LOCK_NONE = 0; /** * Creates an application-level lock on a session. The disadvantage is that the @@ -55,7 +55,7 @@ class PdoSessionHandler extends AbstractSessionHandler * does not require a transaction. * This mode is not available for SQLite and not yet implemented for oci and sqlsrv. */ - const LOCK_ADVISORY = 1; + public const LOCK_ADVISORY = 1; /** * Issues a real row lock. Since it uses a transaction between opening and @@ -63,7 +63,7 @@ class PdoSessionHandler extends AbstractSessionHandler * that you also use for your application logic. This mode is the default because * it's the only reliable solution across DBMSs. */ - const LOCK_TRANSACTIONAL = 2; + public const LOCK_TRANSACTIONAL = 2; private const MAX_LIFETIME = 315576000; diff --git a/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php b/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php index 5fe40fc10..c3090d737 100644 --- a/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php +++ b/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php @@ -22,9 +22,9 @@ use Symfony\Component\HttpFoundation\Session\SessionBagInterface; */ class MetadataBag implements SessionBagInterface { - const CREATED = 'c'; - const UPDATED = 'u'; - const LIFETIME = 'l'; + public const CREATED = 'c'; + public const UPDATED = 'u'; + public const LIFETIME = 'l'; /** * @var string diff --git a/vendor/symfony/http-foundation/composer.json b/vendor/symfony/http-foundation/composer.json index 79f4b396d..7b3a692bd 100644 --- a/vendor/symfony/http-foundation/composer.json +++ b/vendor/symfony/http-foundation/composer.json @@ -18,7 +18,8 @@ "require": { "php": ">=7.1.3", "symfony/mime": "^4.3|^5.0", - "symfony/polyfill-mbstring": "~1.1" + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.15" }, "require-dev": { "predis/predis": "~1.0", diff --git a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php index f864e355f..df4ec5f67 100644 --- a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php +++ b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php @@ -14,6 +14,7 @@ namespace Symfony\Component\HttpKernel\DataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; use Symfony\Component\Stopwatch\Stopwatch; use Symfony\Component\VarDumper\Cloner\Data; use Symfony\Component\VarDumper\Cloner\VarCloner; @@ -43,6 +44,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface private $sourceContextProvider; /** + * @param string|FileLinkFormatter|null $fileLinkFormat * @param DataDumperInterface|Connection|null $dumper */ public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null, string $charset = null, RequestStack $requestStack = null, $dumper = null) diff --git a/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php b/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php index ba68c6b99..56bc6ec19 100644 --- a/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php +++ b/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php @@ -53,12 +53,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter } } - try { - $content = $request->getContent(); - } catch (\LogicException $e) { - // the user already got the request content as a resource - $content = false; - } + $content = $request->getContent(); $sessionMetadata = []; $sessionAttributes = []; diff --git a/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php b/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php index ce38d8860..0e99ee55c 100644 --- a/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php +++ b/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php @@ -37,7 +37,7 @@ use Symfony\Component\HttpKernel\KernelEvents; */ abstract class AbstractSessionListener implements EventSubscriberInterface { - const NO_AUTO_CACHE_CONTROL_HEADER = 'Symfony-Session-NoAutoCacheControl'; + public const NO_AUTO_CACHE_CONTROL_HEADER = 'Symfony-Session-NoAutoCacheControl'; protected $container; private $sessionUsageStack = []; diff --git a/vendor/symfony/http-kernel/HttpKernelInterface.php b/vendor/symfony/http-kernel/HttpKernelInterface.php index 7595d29d0..85fedbbe2 100644 --- a/vendor/symfony/http-kernel/HttpKernelInterface.php +++ b/vendor/symfony/http-kernel/HttpKernelInterface.php @@ -21,8 +21,8 @@ use Symfony\Component\HttpFoundation\Response; */ interface HttpKernelInterface { - const MASTER_REQUEST = 1; - const SUB_REQUEST = 2; + public const MASTER_REQUEST = 1; + public const SUB_REQUEST = 2; /** * Handles a Request to convert it to a Response. diff --git a/vendor/symfony/http-kernel/Kernel.php b/vendor/symfony/http-kernel/Kernel.php index 88b77741c..d0ea1ff62 100644 --- a/vendor/symfony/http-kernel/Kernel.php +++ b/vendor/symfony/http-kernel/Kernel.php @@ -76,15 +76,15 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - const VERSION = '4.4.17'; - const VERSION_ID = 40417; - const MAJOR_VERSION = 4; - const MINOR_VERSION = 4; - const RELEASE_VERSION = 17; - const EXTRA_VERSION = ''; + public const VERSION = '4.4.18'; + public const VERSION_ID = 40418; + public const MAJOR_VERSION = 4; + public const MINOR_VERSION = 4; + public const RELEASE_VERSION = 18; + public const EXTRA_VERSION = ''; - const END_OF_MAINTENANCE = '11/2022'; - const END_OF_LIFE = '11/2023'; + public const END_OF_MAINTENANCE = '11/2022'; + public const END_OF_LIFE = '11/2023'; public function __construct(string $environment, bool $debug) { @@ -858,6 +858,9 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl // replace multiple new lines with a single newline $rawChunk .= preg_replace(['/\n{2,}/S'], "\n", $token[1]); } elseif (\in_array($token[0], [\T_COMMENT, \T_DOC_COMMENT])) { + if (!\in_array($rawChunk[\strlen($rawChunk) - 1], [' ', "\n", "\r", "\t"], true)) { + $rawChunk .= ' '; + } $ignoreSpace = true; } else { $rawChunk .= $token[1]; @@ -865,6 +868,8 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl // The PHP-open tag already has a new-line if (\T_OPEN_TAG === $token[0]) { $ignoreSpace = true; + } else { + $ignoreSpace = false; } } } diff --git a/vendor/symfony/http-kernel/KernelEvents.php b/vendor/symfony/http-kernel/KernelEvents.php index 682561c32..b16141c60 100644 --- a/vendor/symfony/http-kernel/KernelEvents.php +++ b/vendor/symfony/http-kernel/KernelEvents.php @@ -27,7 +27,7 @@ final class KernelEvents * * @Event("Symfony\Component\HttpKernel\Event\RequestEvent") */ - const REQUEST = 'kernel.request'; + public const REQUEST = 'kernel.request'; /** * The EXCEPTION event occurs when an uncaught exception appears. @@ -37,7 +37,7 @@ final class KernelEvents * * @Event("Symfony\Component\HttpKernel\Event\ExceptionEvent") */ - const EXCEPTION = 'kernel.exception'; + public const EXCEPTION = 'kernel.exception'; /** * The VIEW event occurs when the return value of a controller @@ -48,7 +48,7 @@ final class KernelEvents * * @Event("Symfony\Component\HttpKernel\Event\ViewEvent") */ - const VIEW = 'kernel.view'; + public const VIEW = 'kernel.view'; /** * The CONTROLLER event occurs once a controller was found for @@ -59,7 +59,7 @@ final class KernelEvents * * @Event("Symfony\Component\HttpKernel\Event\ControllerEvent") */ - const CONTROLLER = 'kernel.controller'; + public const CONTROLLER = 'kernel.controller'; /** * The CONTROLLER_ARGUMENTS event occurs once controller arguments have been resolved. @@ -69,7 +69,7 @@ final class KernelEvents * * @Event("Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent") */ - const CONTROLLER_ARGUMENTS = 'kernel.controller_arguments'; + public const CONTROLLER_ARGUMENTS = 'kernel.controller_arguments'; /** * The RESPONSE event occurs once a response was created for @@ -80,7 +80,7 @@ final class KernelEvents * * @Event("Symfony\Component\HttpKernel\Event\ResponseEvent") */ - const RESPONSE = 'kernel.response'; + public const RESPONSE = 'kernel.response'; /** * The TERMINATE event occurs once a response was sent. @@ -89,7 +89,7 @@ final class KernelEvents * * @Event("Symfony\Component\HttpKernel\Event\TerminateEvent") */ - const TERMINATE = 'kernel.terminate'; + public const TERMINATE = 'kernel.terminate'; /** * The FINISH_REQUEST event occurs when a response was generated for a request. @@ -99,5 +99,5 @@ final class KernelEvents * * @Event("Symfony\Component\HttpKernel\Event\FinishRequestEvent") */ - const FINISH_REQUEST = 'kernel.finish_request'; + public const FINISH_REQUEST = 'kernel.finish_request'; } diff --git a/vendor/symfony/mime/Email.php b/vendor/symfony/mime/Email.php index edab34f90..459bcf82b 100644 --- a/vendor/symfony/mime/Email.php +++ b/vendor/symfony/mime/Email.php @@ -24,11 +24,11 @@ use Symfony\Component\Mime\Part\TextPart; */ class Email extends Message { - const PRIORITY_HIGHEST = 1; - const PRIORITY_HIGH = 2; - const PRIORITY_NORMAL = 3; - const PRIORITY_LOW = 4; - const PRIORITY_LOWEST = 5; + public const PRIORITY_HIGHEST = 1; + public const PRIORITY_HIGH = 2; + public const PRIORITY_NORMAL = 3; + public const PRIORITY_LOW = 4; + public const PRIORITY_LOWEST = 5; private const PRIORITY_MAP = [ self::PRIORITY_HIGHEST => 'Highest', diff --git a/vendor/symfony/mime/Header/AbstractHeader.php b/vendor/symfony/mime/Header/AbstractHeader.php index e93b87aeb..6843f9fbf 100644 --- a/vendor/symfony/mime/Header/AbstractHeader.php +++ b/vendor/symfony/mime/Header/AbstractHeader.php @@ -20,7 +20,7 @@ use Symfony\Component\Mime\Encoder\QpMimeHeaderEncoder; */ abstract class AbstractHeader implements HeaderInterface { - const PHRASE_PATTERN = '(?:(?:(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?[a-zA-Z0-9!#\$%&\'\*\+\-\/=\?\^_`\{\}\|~]+(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?)|(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?"((?:(?:[ \t]*(?:\r\n))?[ \t])?(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21\x23-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])))*(?:(?:[ \t]*(?:\r\n))?[ \t])?"(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?))+?)'; + public const PHRASE_PATTERN = '(?:(?:(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?[a-zA-Z0-9!#\$%&\'\*\+\-\/=\?\^_`\{\}\|~]+(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?)|(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?"((?:(?:[ \t]*(?:\r\n))?[ \t])?(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21\x23-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])))*(?:(?:[ \t]*(?:\r\n))?[ \t])?"(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?))+?)'; private static $encoder; diff --git a/vendor/symfony/mime/Header/ParameterizedHeader.php b/vendor/symfony/mime/Header/ParameterizedHeader.php index 9d3b905a2..1d167b43b 100644 --- a/vendor/symfony/mime/Header/ParameterizedHeader.php +++ b/vendor/symfony/mime/Header/ParameterizedHeader.php @@ -23,7 +23,7 @@ final class ParameterizedHeader extends UnstructuredHeader * * @var string */ - const TOKEN_REGEX = '(?:[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7E]+)'; + public const TOKEN_REGEX = '(?:[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7E]+)'; private $encoder; private $parameters = []; diff --git a/vendor/symfony/mime/MimeTypes.php b/vendor/symfony/mime/MimeTypes.php index a90809752..77a2542db 100644 --- a/vendor/symfony/mime/MimeTypes.php +++ b/vendor/symfony/mime/MimeTypes.php @@ -173,6 +173,7 @@ final class MimeTypes implements MimeTypesInterface 'application/cdmi-queue' => ['cdmiq'], 'application/cdr' => ['cdr'], 'application/coreldraw' => ['cdr'], + 'application/csv' => ['csv'], 'application/cu-seeme' => ['cu'], 'application/dash+xml' => ['mpd'], 'application/davmount+xml' => ['davmount'], @@ -1960,7 +1961,7 @@ final class MimeTypes implements MimeTypesInterface 'csp' => ['application/vnd.commonspace'], 'css' => ['text/css'], 'cst' => ['application/x-director'], - 'csv' => ['text/csv', 'text/x-comma-separated-values', 'text/x-csv'], + 'csv' => ['text/csv', 'text/x-comma-separated-values', 'text/x-csv', 'application/csv'], 'csvs' => ['text/csv-schema'], 'cu' => ['application/cu-seeme'], 'cue' => ['application/x-cue'], diff --git a/vendor/symfony/mime/Part/TextPart.php b/vendor/symfony/mime/Part/TextPart.php index 20bfd4ae6..ff767cc36 100644 --- a/vendor/symfony/mime/Part/TextPart.php +++ b/vendor/symfony/mime/Part/TextPart.php @@ -39,7 +39,7 @@ class TextPart extends AbstractPart /** * @param resource|string $body */ - public function __construct($body, ?string $charset = 'utf-8', $subtype = 'plain', string $encoding = null) + public function __construct($body, ?string $charset = 'utf-8', string $subtype = 'plain', string $encoding = null) { parent::__construct(); diff --git a/vendor/symfony/process/Exception/ProcessTimedOutException.php b/vendor/symfony/process/Exception/ProcessTimedOutException.php index e1f6445a4..94391a459 100644 --- a/vendor/symfony/process/Exception/ProcessTimedOutException.php +++ b/vendor/symfony/process/Exception/ProcessTimedOutException.php @@ -20,8 +20,8 @@ use Symfony\Component\Process\Process; */ class ProcessTimedOutException extends RuntimeException { - const TYPE_GENERAL = 1; - const TYPE_IDLE = 2; + public const TYPE_GENERAL = 1; + public const TYPE_IDLE = 2; private $process; private $timeoutType; diff --git a/vendor/symfony/process/Pipes/PipesInterface.php b/vendor/symfony/process/Pipes/PipesInterface.php index 2d63e2c05..50eb5c47e 100644 --- a/vendor/symfony/process/Pipes/PipesInterface.php +++ b/vendor/symfony/process/Pipes/PipesInterface.php @@ -20,7 +20,7 @@ namespace Symfony\Component\Process\Pipes; */ interface PipesInterface { - const CHUNK_SIZE = 16384; + public const CHUNK_SIZE = 16384; /** * Returns an array of descriptors for the use of proc_open. diff --git a/vendor/symfony/process/Process.php b/vendor/symfony/process/Process.php index 4e2968e4c..5f8ba6d13 100644 --- a/vendor/symfony/process/Process.php +++ b/vendor/symfony/process/Process.php @@ -30,24 +30,24 @@ use Symfony\Component\Process\Pipes\WindowsPipes; */ class Process implements \IteratorAggregate { - const ERR = 'err'; - const OUT = 'out'; + public const ERR = 'err'; + public const OUT = 'out'; - const STATUS_READY = 'ready'; - const STATUS_STARTED = 'started'; - const STATUS_TERMINATED = 'terminated'; + public const STATUS_READY = 'ready'; + public const STATUS_STARTED = 'started'; + public const STATUS_TERMINATED = 'terminated'; - const STDIN = 0; - const STDOUT = 1; - const STDERR = 2; + public const STDIN = 0; + public const STDOUT = 1; + public const STDERR = 2; // Timeout Precision in seconds. - const TIMEOUT_PRECISION = 0.2; + public const TIMEOUT_PRECISION = 0.2; - const ITER_NON_BLOCKING = 1; // By default, iterating over outputs is a blocking call, use this flag to make it non-blocking - const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory - const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating - const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating + public const ITER_NON_BLOCKING = 1; // By default, iterating over outputs is a blocking call, use this flag to make it non-blocking + public const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory + public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating + public const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating private $callback; private $hasCallback = false; diff --git a/vendor/symfony/routing/Generator/UrlGeneratorInterface.php b/vendor/symfony/routing/Generator/UrlGeneratorInterface.php index 64714d354..2550619a1 100644 --- a/vendor/symfony/routing/Generator/UrlGeneratorInterface.php +++ b/vendor/symfony/routing/Generator/UrlGeneratorInterface.php @@ -34,25 +34,25 @@ interface UrlGeneratorInterface extends RequestContextAwareInterface /** * Generates an absolute URL, e.g. "http://example.com/dir/file". */ - const ABSOLUTE_URL = 0; + public const ABSOLUTE_URL = 0; /** * Generates an absolute path, e.g. "/dir/file". */ - const ABSOLUTE_PATH = 1; + public const ABSOLUTE_PATH = 1; /** * Generates a relative path based on the current request path, e.g. "../parent-file". * * @see UrlGenerator::getRelativePath() */ - const RELATIVE_PATH = 2; + public const RELATIVE_PATH = 2; /** * Generates a network path, e.g. "//example.com/dir/file". * Such reference reuses the current scheme but specifies the host. */ - const NETWORK_PATH = 3; + public const NETWORK_PATH = 3; /** * Generates a URL or path for a specific route based on the given parameters. diff --git a/vendor/symfony/routing/Loader/XmlFileLoader.php b/vendor/symfony/routing/Loader/XmlFileLoader.php index 3b40e3d2a..c78213387 100644 --- a/vendor/symfony/routing/Loader/XmlFileLoader.php +++ b/vendor/symfony/routing/Loader/XmlFileLoader.php @@ -26,8 +26,8 @@ use Symfony\Component\Routing\RouteCompiler; */ class XmlFileLoader extends FileLoader { - const NAMESPACE_URI = 'http://symfony.com/schema/routing'; - const SCHEME_PATH = '/schema/routing/routing-1.0.xsd'; + public const NAMESPACE_URI = 'http://symfony.com/schema/routing'; + public const SCHEME_PATH = '/schema/routing/routing-1.0.xsd'; /** * Loads an XML file. diff --git a/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php b/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php index b687ffb4b..3c8c45168 100644 --- a/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php +++ b/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php @@ -23,9 +23,9 @@ use Symfony\Component\Routing\RouteCollection; */ class TraceableUrlMatcher extends UrlMatcher { - const ROUTE_DOES_NOT_MATCH = 0; - const ROUTE_ALMOST_MATCHES = 1; - const ROUTE_MATCHES = 2; + public const ROUTE_DOES_NOT_MATCH = 0; + public const ROUTE_ALMOST_MATCHES = 1; + public const ROUTE_MATCHES = 2; protected $traces; diff --git a/vendor/symfony/routing/Matcher/UrlMatcher.php b/vendor/symfony/routing/Matcher/UrlMatcher.php index b44dfa1b6..59452d887 100644 --- a/vendor/symfony/routing/Matcher/UrlMatcher.php +++ b/vendor/symfony/routing/Matcher/UrlMatcher.php @@ -28,9 +28,9 @@ use Symfony\Component\Routing\RouteCollection; */ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface { - const REQUIREMENT_MATCH = 0; - const REQUIREMENT_MISMATCH = 1; - const ROUTE_MATCH = 2; + public const REQUIREMENT_MATCH = 0; + public const REQUIREMENT_MISMATCH = 1; + public const ROUTE_MATCH = 2; /** @var RequestContext */ protected $context; diff --git a/vendor/symfony/routing/RouteCompiler.php b/vendor/symfony/routing/RouteCompiler.php index fa63df488..db2bbec7c 100644 --- a/vendor/symfony/routing/RouteCompiler.php +++ b/vendor/symfony/routing/RouteCompiler.php @@ -19,14 +19,14 @@ namespace Symfony\Component\Routing; */ class RouteCompiler implements RouteCompilerInterface { - const REGEX_DELIMITER = '#'; + public const REGEX_DELIMITER = '#'; /** * This string defines the characters that are automatically considered separators in front of * optional placeholders (with default and no static text following). Such a single separator * can be left out together with the optional placeholder from matching and generating URLs. */ - const SEPARATORS = '/,;.:-_~+*=@|'; + public const SEPARATORS = '/,;.:-_~+*=@|'; /** * The maximum supported length of a PCRE subpattern name @@ -34,7 +34,7 @@ class RouteCompiler implements RouteCompilerInterface * * @internal */ - const VARIABLE_MAXIMUM_LENGTH = 32; + public const VARIABLE_MAXIMUM_LENGTH = 32; /** * {@inheritdoc} diff --git a/vendor/symfony/translation/DataCollectorTranslator.php b/vendor/symfony/translation/DataCollectorTranslator.php index 94b9e3e5c..68acf1561 100644 --- a/vendor/symfony/translation/DataCollectorTranslator.php +++ b/vendor/symfony/translation/DataCollectorTranslator.php @@ -22,9 +22,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class DataCollectorTranslator implements LegacyTranslatorInterface, TranslatorInterface, TranslatorBagInterface, WarmableInterface { - const MESSAGE_DEFINED = 0; - const MESSAGE_MISSING = 1; - const MESSAGE_EQUALS_FALLBACK = 2; + public const MESSAGE_DEFINED = 0; + public const MESSAGE_MISSING = 1; + public const MESSAGE_EQUALS_FALLBACK = 2; /** * @var TranslatorInterface|TranslatorBagInterface diff --git a/vendor/symfony/translation/Extractor/PhpExtractor.php b/vendor/symfony/translation/Extractor/PhpExtractor.php index edea36769..88811418c 100644 --- a/vendor/symfony/translation/Extractor/PhpExtractor.php +++ b/vendor/symfony/translation/Extractor/PhpExtractor.php @@ -21,9 +21,9 @@ use Symfony\Component\Translation\MessageCatalogue; */ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface { - const MESSAGE_TOKEN = 300; - const METHOD_ARGUMENTS_TOKEN = 1000; - const DOMAIN_TOKEN = 1001; + public const MESSAGE_TOKEN = 300; + public const METHOD_ARGUMENTS_TOKEN = 1000; + public const DOMAIN_TOKEN = 1001; /** * Prefix for new found message. diff --git a/vendor/symfony/translation/Loader/MoFileLoader.php b/vendor/symfony/translation/Loader/MoFileLoader.php index 1d90136bd..1f2e62ced 100644 --- a/vendor/symfony/translation/Loader/MoFileLoader.php +++ b/vendor/symfony/translation/Loader/MoFileLoader.php @@ -22,18 +22,18 @@ class MoFileLoader extends FileLoader * Magic used for validating the format of a MO file as well as * detecting if the machine used to create that file was little endian. */ - const MO_LITTLE_ENDIAN_MAGIC = 0x950412de; + public const MO_LITTLE_ENDIAN_MAGIC = 0x950412de; /** * Magic used for validating the format of a MO file as well as * detecting if the machine used to create that file was big endian. */ - const MO_BIG_ENDIAN_MAGIC = 0xde120495; + public const MO_BIG_ENDIAN_MAGIC = 0xde120495; /** * The size of the header of a MO file in bytes. */ - const MO_HEADER_SIZE = 28; + public const MO_HEADER_SIZE = 28; /** * Parses machine object (MO) format, independent of the machine's endian it diff --git a/vendor/symfony/translation/MessageCatalogueInterface.php b/vendor/symfony/translation/MessageCatalogueInterface.php index f3d3f5ea9..853ce7031 100644 --- a/vendor/symfony/translation/MessageCatalogueInterface.php +++ b/vendor/symfony/translation/MessageCatalogueInterface.php @@ -20,7 +20,7 @@ use Symfony\Component\Config\Resource\ResourceInterface; */ interface MessageCatalogueInterface { - const INTL_DOMAIN_SUFFIX = '+intl-icu'; + public const INTL_DOMAIN_SUFFIX = '+intl-icu'; /** * Gets the catalogue locale. diff --git a/vendor/symfony/var-dumper/Caster/Caster.php b/vendor/symfony/var-dumper/Caster/Caster.php index 4bdc66ac5..d35f3230b 100644 --- a/vendor/symfony/var-dumper/Caster/Caster.php +++ b/vendor/symfony/var-dumper/Caster/Caster.php @@ -22,20 +22,20 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class Caster { - const EXCLUDE_VERBOSE = 1; - const EXCLUDE_VIRTUAL = 2; - const EXCLUDE_DYNAMIC = 4; - const EXCLUDE_PUBLIC = 8; - const EXCLUDE_PROTECTED = 16; - const EXCLUDE_PRIVATE = 32; - const EXCLUDE_NULL = 64; - const EXCLUDE_EMPTY = 128; - const EXCLUDE_NOT_IMPORTANT = 256; - const EXCLUDE_STRICT = 512; + public const EXCLUDE_VERBOSE = 1; + public const EXCLUDE_VIRTUAL = 2; + public const EXCLUDE_DYNAMIC = 4; + public const EXCLUDE_PUBLIC = 8; + public const EXCLUDE_PROTECTED = 16; + public const EXCLUDE_PRIVATE = 32; + public const EXCLUDE_NULL = 64; + public const EXCLUDE_EMPTY = 128; + public const EXCLUDE_NOT_IMPORTANT = 256; + public const EXCLUDE_STRICT = 512; - const PREFIX_VIRTUAL = "\0~\0"; - const PREFIX_DYNAMIC = "\0+\0"; - const PREFIX_PROTECTED = "\0*\0"; + public const PREFIX_VIRTUAL = "\0~\0"; + public const PREFIX_DYNAMIC = "\0+\0"; + public const PREFIX_PROTECTED = "\0*\0"; /** * Casts objects to arrays and adds the dynamic property prefix. diff --git a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/vendor/symfony/var-dumper/Caster/ReflectionCaster.php index 6be710c16..e0181ba0e 100644 --- a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ b/vendor/symfony/var-dumper/Caster/ReflectionCaster.php @@ -22,7 +22,7 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class ReflectionCaster { - const UNSET_CLOSURE_FILE_INFO = ['Closure' => __CLASS__.'::unsetClosureFileInfo']; + public const UNSET_CLOSURE_FILE_INFO = ['Closure' => __CLASS__.'::unsetClosureFileInfo']; private static $extraMap = [ 'docComment' => 'getDocComment', diff --git a/vendor/symfony/var-dumper/Cloner/Cursor.php b/vendor/symfony/var-dumper/Cloner/Cursor.php index 5b0542f6c..1fd796d67 100644 --- a/vendor/symfony/var-dumper/Cloner/Cursor.php +++ b/vendor/symfony/var-dumper/Cloner/Cursor.php @@ -18,10 +18,10 @@ namespace Symfony\Component\VarDumper\Cloner; */ class Cursor { - const HASH_INDEXED = Stub::ARRAY_INDEXED; - const HASH_ASSOC = Stub::ARRAY_ASSOC; - const HASH_OBJECT = Stub::TYPE_OBJECT; - const HASH_RESOURCE = Stub::TYPE_RESOURCE; + public const HASH_INDEXED = Stub::ARRAY_INDEXED; + public const HASH_ASSOC = Stub::ARRAY_ASSOC; + public const HASH_OBJECT = Stub::TYPE_OBJECT; + public const HASH_RESOURCE = Stub::TYPE_RESOURCE; public $depth = 0; public $refIndex = 0; diff --git a/vendor/symfony/var-dumper/Cloner/Stub.php b/vendor/symfony/var-dumper/Cloner/Stub.php index 7f6d05d33..073c56efb 100644 --- a/vendor/symfony/var-dumper/Cloner/Stub.php +++ b/vendor/symfony/var-dumper/Cloner/Stub.php @@ -18,17 +18,17 @@ namespace Symfony\Component\VarDumper\Cloner; */ class Stub { - const TYPE_REF = 1; - const TYPE_STRING = 2; - const TYPE_ARRAY = 3; - const TYPE_OBJECT = 4; - const TYPE_RESOURCE = 5; + public const TYPE_REF = 1; + public const TYPE_STRING = 2; + public const TYPE_ARRAY = 3; + public const TYPE_OBJECT = 4; + public const TYPE_RESOURCE = 5; - const STRING_BINARY = 1; - const STRING_UTF8 = 2; + public const STRING_BINARY = 1; + public const STRING_UTF8 = 2; - const ARRAY_ASSOC = 1; - const ARRAY_INDEXED = 2; + public const ARRAY_ASSOC = 1; + public const ARRAY_INDEXED = 2; public $type = self::TYPE_REF; public $class = ''; diff --git a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php index 766102e8c..c5c5b9a26 100644 --- a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php @@ -21,10 +21,10 @@ use Symfony\Component\VarDumper\Cloner\DumperInterface; */ abstract class AbstractDumper implements DataDumperInterface, DumperInterface { - const DUMP_LIGHT_ARRAY = 1; - const DUMP_STRING_LENGTH = 2; - const DUMP_COMMA_SEPARATOR = 4; - const DUMP_TRAILING_COMMA = 8; + public const DUMP_LIGHT_ARRAY = 1; + public const DUMP_STRING_LENGTH = 2; + public const DUMP_COMMA_SEPARATOR = 4; + public const DUMP_TRAILING_COMMA = 8; public static $defaultOutput = 'php://output'; diff --git a/vendor/symfony/var-dumper/Dumper/CliDumper.php b/vendor/symfony/var-dumper/Dumper/CliDumper.php index af5cafc67..013a69dd9 100644 --- a/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ b/vendor/symfony/var-dumper/Dumper/CliDumper.php @@ -439,7 +439,8 @@ class CliDumper extends AbstractDumper } if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') && !getenv('KONSOLE_VERSION'); + $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); } if (isset($attr['ellipsis'], $attr['ellipsis-type'])) {