mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Reintroduce Webklex IMAP for ticket processing as PHP-IMAP is no longer being developed. This is optional for now and considered beta can be found in cron/ticket_email_parser.php
This commit is contained in:
55
plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentNoDispositionTest.php
vendored
Normal file
55
plugins/vendor/webklex/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