summaryrefslogtreecommitdiff
path: root/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php')
-rw-r--r--vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php
new file mode 100644
index 0000000..3a1fc51
--- /dev/null
+++ b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/EmbeddedFileTest.php
@@ -0,0 +1,55 @@
+<?php
+
+class Swift_Mime_EmbeddedFileTest extends Swift_Mime_AttachmentTest
+{
+ public function testNestingLevelIsAttachment()
+ {
+ //Overridden
+ }
+
+ public function testNestingLevelIsEmbedded()
+ {
+ $file = $this->_createEmbeddedFile($this->_createHeaderSet(),
+ $this->_createEncoder(), $this->_createCache()
+ );
+ $this->assertEquals(
+ Swift_Mime_MimeEntity::LEVEL_RELATED, $file->getNestingLevel()
+ );
+ }
+
+ public function testIdIsAutoGenerated()
+ {
+ $headers = $this->_createHeaderSet(array(), false);
+ $headers->shouldReceive('addIdHeader')
+ ->once()
+ ->with('Content-ID', '/^.*?@.*?$/D');
+
+ $file = $this->_createEmbeddedFile($headers, $this->_createEncoder(),
+ $this->_createCache()
+ );
+ }
+
+ public function testDefaultDispositionIsInline()
+ {
+ $headers = $this->_createHeaderSet(array(), 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 = array())
+ {
+ return $this->_createEmbeddedFile($headers, $encoder, $cache, $mimeTypes);
+ }
+
+ private function _createEmbeddedFile($headers, $encoder, $cache)
+ {
+ return new Swift_Mime_EmbeddedFile($headers, $encoder, $cache, new Swift_Mime_Grammar());
+ }
+}