summaryrefslogtreecommitdiff
path: root/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke')
-rw-r--r--vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php33
-rw-r--r--vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php23
-rw-r--r--vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php31
-rw-r--r--vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php40
4 files changed, 127 insertions, 0 deletions
diff --git a/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php
new file mode 100644
index 0000000..5a4ccde
--- /dev/null
+++ b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * @group smoke
+ */
+class Swift_Smoke_AttachmentSmokeTest extends SwiftMailerSmokeTestCase
+{
+ private $_attFile;
+
+ protected function setUp()
+ {
+ parent::setup(); // For skip
+ $this->_attFile = __DIR__.'/../../../_samples/files/textfile.zip';
+ }
+
+ public function testAttachmentSending()
+ {
+ $mailer = $this->_getMailer();
+ $message = Swift_Message::newInstance()
+ ->setSubject('[Swift Mailer] AttachmentSmokeTest')
+ ->setFrom(array(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 v4 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
new file mode 100644
index 0000000..c7501d4
--- /dev/null
+++ b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * @group smoke
+ */
+class Swift_Smoke_BasicSmokeTest extends SwiftMailerSmokeTestCase
+{
+ public function testBasicSending()
+ {
+ $mailer = $this->_getMailer();
+ $message = Swift_Message::newInstance()
+ ->setSubject('[Swift Mailer] BasicSmokeTest')
+ ->setFrom(array(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
new file mode 100644
index 0000000..3b13cc5
--- /dev/null
+++ b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @group smoke
+ */
+class Swift_Smoke_HtmlWithAttachmentSmokeTest extends SwiftMailerSmokeTestCase
+{
+ private $_attFile;
+
+ protected function setUp()
+ {
+ $this->_attFile = __DIR__.'/../../../_samples/files/textfile.zip';
+ }
+
+ public function testAttachmentSending()
+ {
+ $mailer = $this->_getMailer();
+ $message = Swift_Message::newInstance('[Swift Mailer] HtmlWithAttachmentSmokeTest')
+ ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer'))
+ ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS)
+ ->attach(Swift_Attachment::fromPath($this->_attFile))
+ ->setBody('<p>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:</p>'.PHP_EOL.
+ '<p><q>This is part of a Swift Mailer v4 smoke test.</q></p>', '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
new file mode 100644
index 0000000..b9ebef5
--- /dev/null
+++ b/vendor/swiftmailer/swiftmailer/tests/smoke/Swift/Smoke/InternationalSmokeTest.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * @group smoke
+ */
+class Swift_Smoke_InternationalSmokeTest extends SwiftMailerSmokeTestCase
+{
+ private $_attFile;
+
+ protected function setUp()
+ {
+ parent::setup(); // For skip
+ $this->_attFile = __DIR__.'/../../../_samples/files/textfile.zip';
+ }
+
+ public function testAttachmentSending()
+ {
+ $mailer = $this->_getMailer();
+ $message = Swift_Message::newInstance()
+ ->setCharset('utf-8')
+ ->setSubject('[Swift Mailer] InternationalSmokeTest (διεθνής)')
+ ->setFrom(array(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 v4 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'
+ );
+ }
+}