| 
 | 1 | +<?php  | 
 | 2 | +/**  | 
 | 3 | + * Shopware 5  | 
 | 4 | + * Copyright (c) shopware AG  | 
 | 5 | + *  | 
 | 6 | + * According to our dual licensing model, this program can be used either  | 
 | 7 | + * under the terms of the GNU Affero General Public License, version 3,  | 
 | 8 | + * or under a proprietary license.  | 
 | 9 | + *  | 
 | 10 | + * The texts of the GNU Affero General Public License with an additional  | 
 | 11 | + * permission and of our proprietary license can be found at and  | 
 | 12 | + * in the LICENSE file you have received along with this program.  | 
 | 13 | + *  | 
 | 14 | + * This program is distributed in the hope that it will be useful,  | 
 | 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of  | 
 | 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  | 
 | 17 | + * GNU Affero General Public License for more details.  | 
 | 18 | + *  | 
 | 19 | + * "Shopware" is a registered trademark of shopware AG.  | 
 | 20 | + * The licensing of the program under the AGPLv3 does not imply a  | 
 | 21 | + * trademark license. Therefore any rights, title and interest in  | 
 | 22 | + * our trademarks remain entirely with us.  | 
 | 23 | + */  | 
 | 24 | + | 
 | 25 | +namespace Shopware\Tests\Functional\Components;  | 
 | 26 | + | 
 | 27 | +use Enlight_Components_Mail;  | 
 | 28 | +use PHPUnit\Framework\TestCase;  | 
 | 29 | +use Shopware\Tests\Functional\Traits\ContainerTrait;  | 
 | 30 | + | 
 | 31 | +class MailTest extends TestCase  | 
 | 32 | +{  | 
 | 33 | +    use ContainerTrait;  | 
 | 34 | + | 
 | 35 | +    public function testMessageId(): void  | 
 | 36 | +    {  | 
 | 37 | +        $mailTransport = $this->getContainer()->get('mailtransport');  | 
 | 38 | + | 
 | 39 | +        $mail = new Enlight_Components_Mail();  | 
 | 40 | +        $mail->setBodyText('Test Hello');  | 
 | 41 | +        $mail-> addTo( '[email protected]');   | 
 | 42 | + | 
 | 43 | +        $mail->send($mailTransport);  | 
 | 44 | + | 
 | 45 | +        $headers = $mail->getHeaders();  | 
 | 46 | +        static::assertArrayHasKey('Message-Id', $headers);  | 
 | 47 | +        $messageId = $headers['Message-Id'][0];  | 
 | 48 | +        static::assertIsString($messageId);  | 
 | 49 | +        static::assertStringContainsString('@', $messageId);  | 
 | 50 | +        static::assertStringStartsWith('<', $messageId);  | 
 | 51 | +        static::assertStringEndsWith('>', $messageId);  | 
 | 52 | +    }  | 
 | 53 | +}  | 
0 commit comments