MOON
Server: Apache
System: Linux res.emeff.ca 3.10.0-962.3.2.lve1.5.24.10.el7.x86_64 #1 SMP Wed Mar 20 07:36:02 EDT 2019 x86_64
User: accemeff (1004)
PHP: 7.0.33
Disabled: NONE
Upload Files
File: /home/accemeff/vendor/swiftmailer/swiftmailer/tests/bug/Swift/Bug274Test.php
<?php

class Swift_Bug274Test extends \PHPUnit\Framework\TestCase
{
    /**
     * @expectedException \Swift_IoException
     * @expectedMessageException The path cannot be empty
     */
    public function testEmptyFileNameAsAttachment()
    {
        $message = new Swift_Message();
        $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');
        }
        $this->addToAssertionCount(1);
    }
}