diff options
Diffstat (limited to 'vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php')
-rw-r--r-- | vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php new file mode 100644 index 0000000..f5f057a --- /dev/null +++ b/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php @@ -0,0 +1,21 @@ +<?php + +class Swift_Bug274Test extends \PHPUnit_Framework_TestCase +{ + public function testEmptyFileNameAsAttachment() + { + $message = new Swift_Message(); + $this->setExpectedException('Swift_IoException', 'The path cannot be empty'); + $message->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'); + } + } +} |