HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/meuwis/lmbm.be/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);
    }
}