summaryrefslogtreecommitdiff
path: root/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php
blob: f5f057aeeda0f8b3285ab45bd38381690e632c26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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');
        }
    }
}