mirror of
https://github.com/itflow-org/itflow
synced 2026-03-03 12:24:51 +00:00
Migrated away from PHP Mail Parser to the new WebKlex PHP IMAP Mail Parser this will open the way to support OAUTH2 for Mail servers such as Microsoft 365 and Google Workspaces
This commit is contained in:
55
plugins/php-imap/tests/fixtures/AttachmentNoDispositionTest.php
vendored
Normal file
55
plugins/php-imap/tests/fixtures/AttachmentNoDispositionTest.php
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/*
|
||||
* File: AttachmentNoDispositionTest.php
|
||||
* Category: -
|
||||
* Author: M.Goldenbaum
|
||||
* Created: 09.03.23 02:24
|
||||
* Updated: -
|
||||
*
|
||||
* Description:
|
||||
* -
|
||||
*/
|
||||
|
||||
namespace Tests\fixtures;
|
||||
|
||||
use Webklex\PHPIMAP\Attachment;
|
||||
|
||||
/**
|
||||
* Class AttachmentNoDispositionTest
|
||||
*
|
||||
* @package Tests\fixtures
|
||||
*/
|
||||
class AttachmentNoDispositionTest extends FixtureTestCase {
|
||||
|
||||
/**
|
||||
* Test the fixture attachment_no_disposition.eml
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testFixture() : void {
|
||||
$message = $this->getFixture("attachment_no_disposition.eml");
|
||||
|
||||
self::assertEquals("", $message->subject);
|
||||
self::assertEquals("multipart/mixed", $message->content_type->last());
|
||||
self::assertFalse($message->hasTextBody());
|
||||
self::assertFalse($message->hasHTMLBody());
|
||||
|
||||
self::assertCount(1, $message->attachments());
|
||||
|
||||
$attachment = $message->attachments()->first();
|
||||
|
||||
self::assertInstanceOf(Attachment::class, $attachment);
|
||||
self::assertEquals('26ed3dd2', $attachment->filename);
|
||||
self::assertEquals('26ed3dd2', $attachment->id);
|
||||
self::assertEquals("Prostřeno_2014_poslední volné termíny.xls", $attachment->name);
|
||||
self::assertEquals('text', $attachment->type);
|
||||
self::assertEquals('xls', $attachment->getExtension());
|
||||
self::assertEquals("application/vnd.ms-excel", $attachment->content_type);
|
||||
self::assertEquals("a0ef7cfbc05b73dbcb298fe0bc224b41900cdaf60f9904e3fea5ba6c7670013c", hash("sha256", $attachment->content));
|
||||
self::assertEquals(146, $attachment->size);
|
||||
self::assertEquals(0, $attachment->part_number);
|
||||
self::assertNull($attachment->disposition);
|
||||
self::assertNotEmpty($attachment->id);
|
||||
self::assertEmpty($attachment->content_id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user